Opened 18 years ago
Closed 18 years ago
#4279 closed (duplicate)
Non-null TEMPLATE_STRING_IF_INVALID breaks admin UI
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | admin template template_string_if_invalid | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The default admin templates include various lookups that are expected to fail under many conditions, but this only works nicely if TEMPLATE_STRING_IF_INVALID is the default ("").
For example, the contrib.admin.templatetags.results_headers yields dictionaries that often don't have class_attribs as a key, but the related template, admin/change_list_results.html, includes this code:
<th{{ header.class_attrib }}>
A non-null-string TEMPLATE_STRING_IF_INVALID causes the code to have an invalid tag type.
I'll hopefully soon file a patch, but wanted to report the issue in the meantime.
There was documentation added about this. There is also an open ticket that aims to remove the admin interface's reliance on an empty string TEMPLATE_STRING_IF_INVALID setting.