Undefined context variables should not resolve to the value of TEMPLATE_STRING_IF_INVALID
The new TEMPLATE_STRING_IF_INVALID is a useful setting but it seems to have some problems currently. With the current implementation undefined context variables are actually resolved to the value of TEMPLATE_STRING_IF_INVALID. This means that {% if
some_undefined_variable %} can evaluate true. Also FilterExpression
is passing the
TEMPLATE_STRING_IF_INVALID value through the filters, which is probably not going to fit with user expectations.
Perhaps resolve_variable
should be consistently raising an exception
for all unresolvable variables and Node
renderers and FilterExpression
should be returning TEMPLATE_STRING_IF_INVALID directly where appropriate. This would be slightly backwards
incompatible for people using the guts of the template renderer in their template tags.
Change History
(6)
Owner: |
changed from Adrian Holovaty to Russell Keith-Magee
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Component: |
Template system → Generic views
|
priority: |
normal → lowest
|
Severity: |
major → trivial
|
Type: |
defect → task
|
Version: |
→ SVN
|
When I set
in my settings.py, then suddenly inside the admin I won't have the header anymore (the blue bar with "Welcome", documentation, change password, logout, the breadcrumps). So I removed this setting immediately.
I think this is related to this bug.