summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortim-mccurrach <34194722+tim-mccurrach@users.noreply.github.com>2021-03-03 08:13:07 +0000
committerGitHub <noreply@github.com>2021-03-03 09:13:07 +0100
commitf55f3ce831fa885dfef0b222c254bb4bf3ca99ef (patch)
tree6c66c7c35ed8ce2b3cf02da68d457d63acf670c0
parent2b1de3dd242b473cd084e7ff9b9b10d488dcabad (diff)
Fixed #32493 -- Removed redundant never_cache uses from admin views.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
-rw-r--r--django/contrib/admin/sites.py2
-rw-r--r--docs/releases/4.0.txt5
2 files changed, 5 insertions, 2 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index 7bc1519c2b..ba9b032914 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -358,7 +358,6 @@ class AdminSite:
"""
return JavaScriptCatalog.as_view(packages=['django.contrib.admin'])(request)
- @method_decorator(never_cache)
def logout(self, request, extra_context=None):
"""
Log out the user for the given HttpRequest.
@@ -515,7 +514,6 @@ class AdminSite:
return app_list
- @method_decorator(never_cache)
def index(self, request, extra_context=None):
"""
Display the main admin index page, which lists all of the installed
diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt
index 7ea518cbc9..7fca85f8f9 100644
--- a/docs/releases/4.0.txt
+++ b/docs/releases/4.0.txt
@@ -311,6 +311,11 @@ Miscellaneous
:setting:`STATIC_URL`, the leading slash is removed from that setting (now
``'static/'``) in the default :djadmin:`startproject` template.
+* The :class:`~django.contrib.admin.AdminSite` method for the admin ``index``
+ view is no longer decorated with ``never_cache`` when accessed directly,
+ rather than via the recommended ``AdminSite.urls`` property, or
+ ``AdminSite.get_urls()`` method.
+
.. _deprecated-features-4.0:
Features deprecated in 4.0