Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9637 closed (fixed)

extrastyle block in customized admin/base_site.html overridden by extending templates

Reported by: rvdrijst Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: admin template extrastyle base_site.html
Cc: rvdrijst@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In changeset:9463 the following default admin templates were changed to use the {% block extrastyle %} declared in admin/base.html:

  • django/contrib/admin/templates/admin/change_form.html
  • django/contrib/admin/templates/admin/change_list.html
  • django/contrib/admin/templates/admin/index.html
  • django/contrib/admin/templates/admin/login.html

These four templates extend admin/base_site.html, not admin/base.html and although the default admin/base_site.html doesn't override the {% block extrastyle %}, a customized version of this template might. In that case, the contents of this {% block extrastyle %} are overridden by the four mentioned templates, which is a bug.

The solution is simple enough: prefix the content of the {% block extrastyle %} in these four templates with {{ block.super }} to render the possible content of the {% block extrastyle %} in a customized base_site.html (see patch).

Attachments (1)

patch.txt (2.7 KB) - added by rvdrijst 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by rvdrijst

comment:1 Changed 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

This was fixed in r9690 . (I don't know why it wasn't automatically closed)

comment:2 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.