From d21f3d9b171a3cbff4c8ce7a9dbb8b8be3f21bac Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 17 Sep 2012 19:52:22 +0200 Subject: [PATCH] Only update `last_login` instead of the whole user object in `update_last_login`. --- django/contrib/auth/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)