On Mon, Oct 21, 2013 at 12:25 AM, Harry Percival
<[email protected]>wrote:

> I don't care about last_login!  Can this be circumvented?  Should that
> signal be optional, or gracefully handle the case where the user model has
> no last_login field?  Should I log this as a bug?


No, this is not a bug, it is by design. Django needs the last_login field
for generating password reset tokens [0], and I guess you do want to leave
that functionality in there. It is also not going to change anytime soon.
Please look at another recent thread on this list about this same subject,
and some reasoning from the core devs behind it.

If you really want a 'bare' User model, you can, you just can't use other
contrib.auth stuff and contrib.admin stuff, as they expect more than just
and identifier (like password reset, permissions and groups).

If you want to make it easy for yourself, have a look at
django-authtools[1]. The last_login field will still be there, but it saves
you quite some lines of code, and it is not like that little database
column is gonna cost you. (I know, it feels impure. I had that feeling for
quite a while too, but hé, practicality beats purity :).

Tino

[0]
https://github.com/django/django/blob/master/django/contrib/auth/tokens.py#L59
[1]
https://django-authtools.readthedocs.org/en/latest/intro.html#but-it-s-supposed-to-be-a-custom-user-model

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANQFsQBNR-V0f0GD4WV3YoNz7m1WJBJc-w6%2BXas5Vaw7-tDCjw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to