Ticket #2368: logout.diff

File logout.diff, 657 bytes (added by Gary Wilson <gary.wilson@…>, 18 years ago)
  • django/contrib/auth/__init__.py

     
    5656    """
    5757    Remove the authenticated user's ID from the request.
    5858    """
    59     del request.session[SESSION_KEY]
    60     del request.session[BACKEND_SESSION_KEY]
     59    try:
     60        del request.session[SESSION_KEY]
     61    except KeyError:
     62        pass
     63    try:
     64        del request.session[BACKEND_SESSION_KEY]
     65    except KeyError:
     66        pass
    6167
    6268def get_user(request):
    6369    from django.contrib.auth.models import AnonymousUser
Back to Top