Permalink
Browse files

Only update `last_login` instead of the whole user object in `update_…

…last_login`.
  • Loading branch information...
1 parent a630d08 commit d21f3d9b171a3cbff4c8ce7a9dbb8b8be3f21bac @apollo13 apollo13 committed Sep 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/contrib/auth/models.py
View
2 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)

0 comments on commit d21f3d9

Please sign in to comment.