Opened 4 years ago
Closed 4 years ago
#32385 closed Cleanup/optimization (fixed)
contrib.admin's base template loads i18n twice
Reported by: | Jim | Owned by: | Tim McCurrach |
---|---|---|---|
Component: | contrib.admin | Version: | 3.1 |
Severity: | Normal | Keywords: | admin, template |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Why is i18n
loaded twice in the admin base template https://github.com/django/django/blame/master/django/contrib/admin/templates/admin/base.html#L21 ?
Following the links to the MRs in the blame view, there seems to be new no apparent reason, for the template tag to be loaded twice, so I assume this didn't happen on purpose and the 2nd occurrence should be removed.
Change History (6)
comment:1 by , 4 years ago
Version: | 3.0 → 3.1 |
---|
comment:2 by , 4 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
follow-up: 5 comment:4 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I have created a PR for this. I had a look through the other templates in contrib, to check for any similar instances of this. I didn't find any duplicates but I did notice:
...admin/prepopulated_fields_js.html
loadsl10n
but doesn't appear to use any l10n template tags...admin/change_list_results.html
and...admin/edit_inline/stacked.html
loadsstatic
but doesn't appear to use any static template tags
Is it okay to remove those as well, and turn this into a general template tags clear-up ticket. Or should they go into their own ticket?
comment:5 by , 4 years ago
Replying to Tim McCurrach:
I have created a PR for this. I had a look through the other templates in contrib, to check for any similar instances of this. I didn't find any duplicates but I did notice:
...admin/prepopulated_fields_js.html
loadsl10n
but doesn't appear to use any l10n template tags...admin/change_list_results.html
and...admin/edit_inline/stacked.html
loadsstatic
but doesn't appear to use any static template tagsIs it okay to remove those as well, and turn this into a general template tags clear-up ticket. Or should they go into their own ticket?
Thanks for checking this, we can remove them in the same PR:
l10n
is unused inprepopulated_fields_js.html
since d638cdc42acec608c1967f44af6be32a477c239f,static
is unused inchange_list_results.html
since f2ed107b079b050950e2fc5f2b689ca553ae12f5,static
is unused instacked.html
since d61ebc8fed212366340b1ed6f5d7722613801459.
Good catch!