Commits

Anonymous committed aee3d61

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.

Comments (0)

Files changed (2)

django/contrib/admin/sites.py

         # 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)
                         # 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)

django/views/decorators/cache.py

     """
     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)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.