Ticket #3029: contrib_auth_date_fields_errors.patch
File contrib_auth_date_fields_errors.patch, 2.0 KB (added by , 18 years ago) |
---|
-
__init__.py
1 1 from django.core.exceptions import ImproperlyConfigured 2 import datetime 2 3 3 4 SESSION_KEY = '_auth_user_id' 4 5 BACKEND_SESSION_KEY = '_auth_user_backend' … … 37 38 continue 38 39 if user is None: 39 40 continue 41 # User has been authenticated; update user's last login datetime 42 user.last_login = datetime.datetime.now() 43 user.save() 40 44 # Annotate the user object with the path of the backend. 41 45 user.backend = "%s.%s" % (backend.__module__, backend.__class__.__name__) 42 46 return user -
models.py
95 95 is_staff = models.BooleanField(_('staff status'), default=False, help_text=_("Designates whether the user can log into this admin site.")) 96 96 is_active = models.BooleanField(_('active'), default=True, help_text=_("Designates whether this user can log into the Django admin. Unselect this instead of deleting accounts.")) 97 97 is_superuser = models.BooleanField(_('superuser status'), default=False, help_text=_("Designates that this user has all permissions without explicitly assigning them.")) 98 last_login = models.DateTimeField(_('last login'), default=models.LazyDate())99 date_joined = models.DateTimeField(_('date joined'), default=models.LazyDate())98 last_login = models.DateTimeField(_('last login'), auto_now_add=True) 99 date_joined = models.DateTimeField(_('date joined'), auto_now_add=True) 100 100 groups = models.ManyToManyField(Group, verbose_name=_('groups'), blank=True, 101 101 help_text=_("In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in.")) 102 102 user_permissions = models.ManyToManyField(Permission, verbose_name=_('user permissions'), blank=True, filter_interface=models.HORIZONTAL)