Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #15043 -- Updated the login function to send the user_logged_in…

… signal after the user's session got recycled instead of before. Thanks, Rob Hudson.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 730769d commit 937548bba45c6933dab774b59fded8f0055e8937 @jezdez jezdez committed
Showing with 1 addition and 2 deletions.
  1. +1 −2  django/contrib/auth/
3  django/contrib/auth/
@@ -70,8 +70,6 @@ def login(request, user):
if user is None:
user = request.user
# TODO: It would be nice to support different login methods, like signed cookies.
- user_logged_in.send(sender=user.__class__, request=request, user=user)
if SESSION_KEY in request.session:
if request.session[SESSION_KEY] !=
# To avoid reusing another user's session, create a new, empty
@@ -84,6 +82,7 @@ def login(request, user):
request.session[BACKEND_SESSION_KEY] = user.backend
if hasattr(request, 'user'):
request.user = user
+ user_logged_in.send(sender=user.__class__, request=request, user=user)
def logout(request):

0 comments on commit 937548b

Please sign in to comment.
Something went wrong with that request. Please try again.