Code

Ticket #3060: auth-timestamp-patch.diff

File auth-timestamp-patch.diff, 1.4 KB (added by Ronny Pfannschmidt <ronny.pfannschmidt@…>, 8 years ago)
Line 
1Index: django/contrib/auth/models.py
2===================================================================
3--- django/contrib/auth/models.py       (Revision 4088)
4+++ django/contrib/auth/models.py       (Arbeitskopie)
5@@ -95,8 +95,8 @@
6     is_staff = models.BooleanField(_('staff status'), default=False, help_text=_("Designates whether the user can log into this admin site."))
7     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."))
8     is_superuser = models.BooleanField(_('superuser status'), default=False, help_text=_("Designates that this user has all permissions without explicitly assigning them."))
9-    last_login = models.DateTimeField(_('last login'), default=models.LazyDate())
10-    date_joined = models.DateTimeField(_('date joined'), default=models.LazyDate())
11+    last_login = models.DateTimeField(_('last login'), default=models.LazyDate(), auto_now_add=True)
12+    date_joined = models.DateTimeField(_('date joined'), default=models.LazyDate(), auto_now_add=True)
13     groups = models.ManyToManyField(Group, verbose_name=_('groups'), blank=True,
14         help_text=_("In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in."))
15     user_permissions = models.ManyToManyField(Permission, verbose_name=_('user permissions'), blank=True, filter_interface=models.HORIZONTAL)