Skip to content

Commit

Permalink
Suppress nullable user.last_login.
Browse files Browse the repository at this point in the history
  • Loading branch information
thebarbershop committed Jun 17, 2020
1 parent a20ce1a commit 1cb5bc2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
3 changes: 2 additions & 1 deletion django/contrib/auth/base_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
check_password, is_password_usable, make_password,
)
from django.db import models
from django.utils import timezone
from django.utils.crypto import get_random_string, salted_hmac
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -48,7 +49,7 @@ def get_by_natural_key(self, username):
@python_2_unicode_compatible
class AbstractBaseUser(models.Model):
password = models.CharField(_('password'), max_length=128)
last_login = models.DateTimeField(_('last login'), blank=True, null=True)
last_login = models.DateTimeField(_('last login'), default=timezone.now)

is_active = True

Expand Down
19 changes: 0 additions & 19 deletions django/contrib/auth/migrations/0005_alter_user_last_login_null.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('auth', '0005_alter_user_last_login_null'),
('auth', '0004_alter_user_username_opts'),
('contenttypes', '0002_remove_content_type_name'),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Migration(migrations.Migration):

dependencies = [
('auth', '0006_require_contenttypes_0002'),
('auth', '0005_require_contenttypes_0002'),
]

operations = [
Expand Down

0 comments on commit 1cb5bc2

Please sign in to comment.