summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-07-16 03:42:42 +0000
committerBrian Rosner <brosner@gmail.com>2008-07-16 03:42:42 +0000
commit885ade77846f720c553e449947a2148f58e85577 (patch)
treece4137155016f7be55d05ec2f47ef4b8166cacf2
parent83afd39b1aa0e4235a8490ebc7219f97c35a0106 (diff)
newforms-admin: Fixed #7553 -- Reverted [7824] in favor of a better fix in #7553. The never_cache decorator is no longer special casing None. Thanks Michael Newman for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/admin/sites.py12
-rw-r--r--django/views/decorators/cache.py5
2 files changed, 5 insertions, 12 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index acceaa9cc5..bb4dc58ece 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -118,14 +118,10 @@ class AdminSite(object):
# The 'logout' view doesn't require that the person is logged in.
if url == 'logout':
return self.logout(request)
-
+
+ # Check permission to continue or display login form.
if not self.has_permission(request):
- response = self.login(request)
- if response:
- # make sure that there is a response before returning
- # this addresses any post data that might persist from
- # expired sessions and continue through (#5999)
- return response
+ return self.login(request)
if url == '':
return self.index(request)
@@ -262,7 +258,7 @@ class AdminSite(object):
# overwrite request.POST with the saved post_data, and continue
request.POST = post_data
request.user = user
- return None
+ return self.root(request, request.path.split(self.root_path)[-1])
else:
request.session.delete_test_cookie()
return http.HttpResponseRedirect(request.path)
diff --git a/django/views/decorators/cache.py b/django/views/decorators/cache.py
index 5f2bec20be..8b620c1345 100644
--- a/django/views/decorators/cache.py
+++ b/django/views/decorators/cache.py
@@ -42,9 +42,6 @@ def never_cache(view_func):
"""
def _wrapped_view_func(request, *args, **kwargs):
response = view_func(request, *args, **kwargs)
- # Although rare, it is possible for a view to return None (e.g. the
- # django.contrib.admin.sites.AdminSite.login view in one corner-case)
- if response:
- add_never_cache_headers(response)
+ add_never_cache_headers(response)
return response
return wraps(view_func)(_wrapped_view_func)