diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2012-09-17 19:52:22 +0200 |
|---|---|---|
| committer | Florian Apolloner <florian@apolloner.eu> | 2012-09-17 19:52:22 +0200 |
| commit | d21f3d9b171a3cbff4c8ce7a9dbb8b8be3f21bac (patch) | |
| tree | 104f848ace44f63e1ee4647ef5281883cf689710 | |
| parent | a630d08483267fbeb461f2fb06313d0e17ef6d44 (diff) | |
Only update `last_login` instead of the whole user object in `update_last_login`.
| -rw-r--r-- | django/contrib/auth/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 1c21917a8c..98eb44ea05 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -25,7 +25,7 @@ def update_last_login(sender, user, **kwargs): the user logging in. """ user.last_login = timezone.now() - user.save() + user.save(update_fields=['last_login']) user_logged_in.connect(update_last_login) |
