mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #2368 -- Fixed KeyError when trying to log out more than once. Thanks, Gary Wilson
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c4679bb83f
commit
c19ef69c5c
@ -56,8 +56,14 @@ def logout(request):
|
||||
"""
|
||||
Remove the authenticated user's ID from the request.
|
||||
"""
|
||||
del request.session[SESSION_KEY]
|
||||
del request.session[BACKEND_SESSION_KEY]
|
||||
try:
|
||||
del request.session[SESSION_KEY]
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
del request.session[BACKEND_SESSION_KEY]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
def get_user(request):
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
Loading…
Reference in New Issue
Block a user