Ticket #4015: request_user.diff

File request_user.diff, 686 bytes (added by Vinay Sajip <vinay_sajip@…>, 18 years ago)

Patch to update request.user in login and logout

  • django/contrib/auth/__init__.py

     
    5353    user.save()
    5454    request.session[SESSION_KEY] = user.id
    5555    request.session[BACKEND_SESSION_KEY] = user.backend
     56    request.user = user
    5657
    5758def logout(request):
    5859    """
     
    6667        del request.session[BACKEND_SESSION_KEY]
    6768    except KeyError:
    6869        pass
     70    from django.contrib.auth.models import AnonymousUser
     71    request.user = AnonymousUser()
    6972
    7073def get_user(request):
    7174    from django.contrib.auth.models import AnonymousUser
Back to Top