Fixed #2405 -- Fixed recursion error in auth.views.logout(), caused by [3402]. Thanks, Jay Skabber

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3431 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-07-23 23:14:36 +00:00
parent 20831e0d2f
commit 564d556519
1 changed files with 2 additions and 3 deletions

View File

@ -34,9 +34,8 @@ def login(request, template_name='registration/login.html'):
def logout(request, next_page=None, template_name='registration/logged_out.html'): def logout(request, next_page=None, template_name='registration/logged_out.html'):
"Logs out the user and displays 'You are logged out' message." "Logs out the user and displays 'You are logged out' message."
from django.contrib.auth import logout from django.contrib.auth import logout
try: logout(request)
logout(request) if next_page is None:
except KeyError:
return render_to_response(template_name, {'title': _('Logged out')}, context_instance=RequestContext(request)) return render_to_response(template_name, {'title': _('Logged out')}, context_instance=RequestContext(request))
else: else:
# Redirect to this page until the session has been cleared. # Redirect to this page until the session has been cleared.