diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index c34a4a3..1170b65 100644
a
|
b
|
def logout(request, next_page=None,
|
74 | 74 | "Logs out the user and displays 'You are logged out' message." |
75 | 75 | from django.contrib.auth import logout |
76 | 76 | logout(request) |
| 77 | redirect_to = request.REQUEST.get(redirect_field_name, '') |
| 78 | if redirect_to: |
| 79 | return HttpResponseRedirect(redirect_to) |
| 80 | |
77 | 81 | if next_page is None: |
78 | | redirect_to = request.REQUEST.get(redirect_field_name, '') |
79 | | if redirect_to: |
80 | | return HttpResponseRedirect(redirect_to) |
81 | | else: |
82 | | current_site = get_current_site(request) |
83 | | context = { |
84 | | 'site': current_site, |
85 | | 'site_name': current_site.name, |
86 | | 'title': _('Logged out') |
87 | | } |
88 | | context.update(extra_context or {}) |
89 | | return render_to_response(template_name, context, |
90 | | context_instance=RequestContext(request, current_app=current_app)) |
| 82 | current_site = get_current_site(request) |
| 83 | context = { |
| 84 | 'site': current_site, |
| 85 | 'site_name': current_site.name, |
| 86 | 'title': _('Logged out') |
| 87 | } |
| 88 | context.update(extra_context or {}) |
| 89 | return render_to_response(template_name, context, |
| 90 | context_instance=RequestContext(request, current_app=current_app)) |
91 | 91 | else: |
92 | 92 | # Redirect to this page until the session has been cleared. |
93 | 93 | return HttpResponseRedirect(next_page or request.path) |