From dbfb35b54225b7f3cf188ea6dba143a589924a0f Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 22 Jul 2005 00:49:53 +0000 Subject: [PATCH] Fixed #145 -- Changed admin logout to use views.auth.login.logout, which uses redirects to ensure cookies aren't stale. Thanks, sdelatorre@gmail.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@287 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../admin_templates/{ => registration}/logged_out.html | 0 django/conf/urls/admin.py | 2 +- django/views/admin/main.py | 8 -------- 3 files changed, 1 insertion(+), 9 deletions(-) rename django/conf/admin_templates/{ => registration}/logged_out.html (100%) diff --git a/django/conf/admin_templates/logged_out.html b/django/conf/admin_templates/registration/logged_out.html similarity index 100% rename from django/conf/admin_templates/logged_out.html rename to django/conf/admin_templates/registration/logged_out.html diff --git a/django/conf/urls/admin.py b/django/conf/urls/admin.py index 92d5d1bc9e..a55da5d366 100644 --- a/django/conf/urls/admin.py +++ b/django/conf/urls/admin.py @@ -3,7 +3,7 @@ from django.conf.settings import INSTALLED_APPS urlpatterns = ( ('^/?$', 'django.views.admin.main.index'), - ('^logout/$', 'django.views.admin.main.logout'), + ('^logout/$', 'django.views.auth.login.logout'), ('^password_change/$', 'django.views.registration.passwords.password_change'), ('^password_change/done/$', 'django.views.registration.passwords.password_change_done'), ('^template_validator/$', 'django.views.admin.template.template_validator'), diff --git a/django/views/admin/main.py b/django/views/admin/main.py index f5772ef547..f413e79123 100644 --- a/django/views/admin/main.py +++ b/django/views/admin/main.py @@ -50,14 +50,6 @@ def index(request): c = Context(request, {'title': 'Site administration'}) return HttpResponse(t.render(c)) -def logout(request): - request.session.delete() - t = template_loader.get_template('logged_out') - c = Context(request, { - 'title': "You're logged out", - }) - return HttpResponse(t.render(c)) - def change_list(request, app_label, module_name): from django.core import paginator from django.utils import dateformat