Opened 3 years ago
Closed 3 years ago
#33221 closed Cleanup/optimization (wontfix)
AdminSite.each_context() collected app_list always, for every user and view.
Reported by: | Maxim Danilov | Owned by: | Vishal Pandey |
---|---|---|---|
Component: | contrib.admin | Version: | 3.2 |
Severity: | Normal | Keywords: | admin, AdminSite |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
AdminSite each_context collected app_list always.
It means it works for all user, dont matter is anonymous or not. But it should work only for internal admin pages.
This views probably should not to call each_context or collect app_list ewery time:
autocomplete/
jsi18n/
login/
logout/
I dont know about "view_on_site" view.
Right now i put something like this:
def get_app_list(self, request): return super(AdminSite, self).get_app_list(request) if request.user.is_authenticated else []
Change History (2)
comment:1 by , 3 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 3 years ago
Easy pickings: | unset |
---|---|
Resolution: | → wontfix |
Status: | assigned → closed |
Summary: | AdminSite each_context collected app_list always, for every user and view → AdminSite.each_context() collected app_list always, for every user and view. |
Note:
See TracTickets
for help on using tickets.
Thanks for this proposition, however it's clearly documented that
each_context()
"Returns a dictionary of variables to put in the template context for every page in the admin site...". I don't think it's worth backward compatibility concerns.