mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Added request.session.delete_test_cookie()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@669 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -81,6 +81,7 @@ class AdminUserRequired:
|
||||
request.user = user
|
||||
return
|
||||
else:
|
||||
request.session.delete_test_cookie()
|
||||
return httpwrappers.HttpResponseRedirect(request.path)
|
||||
else:
|
||||
return self.display_login_form(request, ERROR_MESSAGE)
|
||||
|
||||
@@ -30,6 +30,9 @@ class SessionWrapper(object):
|
||||
def test_cookie_worked(self):
|
||||
return self.get(TEST_COOKIE_NAME) == TEST_COOKIE_VALUE
|
||||
|
||||
def delete_test_cookie(self):
|
||||
del self[TEST_COOKIE_NAME]
|
||||
|
||||
def _get_session(self):
|
||||
# Lazily loads session from storage.
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user