[Django] #32493: Remove unnecessary use of never_cache in admin views

4 views
Skip to first unread message

Django

unread,
Mar 1, 2021, 1:07:43 PM3/1/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim | Owner: Tim McCurrach
McCurrach |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: 3.1
contrib.admin |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
All admin views (apart from login) are wrapped with `self.admin_view`
which applies `never_cache` already. Decorating the views themselves with
`never_cache` is superfluous.

--
Ticket URL: <https://code.djangoproject.com/ticket/32493>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 1, 2021, 1:59:58 PM3/1/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim McCurrach | Owner: Tim
Type: | McCurrach
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim McCurrach):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32493#comment:1>

Django

unread,
Mar 2, 2021, 4:05:41 AM3/2/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim McCurrach | Owner: Tim
Type: | McCurrach
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

OK, I'll accept this as it looks correct… — I feel like we should have
**some** tests that admin views are in fact correctly wrapped, but e.g.
#32468 didn't have them 🤔

--
Ticket URL: <https://code.djangoproject.com/ticket/32493#comment:2>

Django

unread,
Mar 2, 2021, 4:10:53 AM3/2/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim McCurrach | Owner: Tim
Type: | McCurrach
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:2 Carlton Gibson]:


> OK, I'll accept this as it looks correct… — I feel like we should have
**some** tests that admin views are in fact correctly wrapped, but e.g.
#32468 didn't have them 🤔

A lot of tests crash without 63bbfa9f4501425f4bdabe05a79132a22dfbeb5a
because we added an error message in the subsequent commit
3fd82a62415e748002435e7bad06b5017507777c.

--
Ticket URL: <https://code.djangoproject.com/ticket/32493#comment:3>

Django

unread,
Mar 2, 2021, 4:16:33 AM3/2/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim McCurrach | Owner: Tim
Type: | McCurrach
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

> I feel like we should have some tests...

Covered by `admin_views.tests.NeverCacheTests`

--
Ticket URL: <https://code.djangoproject.com/ticket/32493#comment:4>

Django

unread,
Mar 2, 2021, 4:45:41 AM3/2/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim McCurrach | Owner: Tim
Type: | McCurrach
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32493#comment:5>

Django

unread,
Mar 3, 2021, 3:13:22 AM3/3/21
to django-...@googlegroups.com
#32493: Remove unnecessary use of never_cache in admin views
-------------------------------------+-------------------------------------
Reporter: Tim McCurrach | Owner: Tim
Type: | McCurrach
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"f55f3ce831fa885dfef0b222c254bb4bf3ca99ef" f55f3ce8]:
{{{
#!CommitTicketReference repository=""
revision="f55f3ce831fa885dfef0b222c254bb4bf3ca99ef"
Fixed #32493 -- Removed redundant never_cache uses from admin views.

Co-authored-by: Carlton Gibson <carlton...@noumenal.es>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32493#comment:6>

Reply all
Reply to author
Forward
0 new messages