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 Jim, 4 years ago

Version: 3.03.1

comment:2 by Claude Paroz, 4 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

Good catch!

comment:3 by Jim, 4 years ago

Has patch: set

comment:4 by Tim McCurrach, 4 years ago

Owner: changed from nobody to Tim McCurrach
Status: newassigned

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 loads l10n but doesn't appear to use any l10n template tags
  • ...admin/change_list_results.html and ...admin/edit_inline/stacked.html loads static 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?

in reply to:  4 comment:5 by Mariusz Felisiak, 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 loads l10n but doesn't appear to use any l10n template tags
  • ...admin/change_list_results.html and ...admin/edit_inline/stacked.html loads static 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?

Thanks for checking this, we can remove them in the same PR:

comment:6 by GitHub <noreply@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In a736baab:

Fixed #32385 -- Removed unused and duplicated loading of tags in admin templates.

Note: See TracTickets for help on using tickets.
Back to Top