Opened 18 years ago
Closed 18 years ago
#2637 closed defect (fixed)
[patch] Filters no longer parsed for unresolved variables
Reported by: | Chris Beaven | Owned by: | Russell Keith-Magee |
---|---|---|---|
Component: | Template system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Changeset [3268] made the following change for the resolve method in django/template/init.py:
- obj = settings.TEMPLATE_STRING_IF_INVALID + if ignore_failures: + return None + else: + return settings.TEMPLATE_STRING_IF_INVALID
Because TEMPLATE_STRING_IF_INVALID
is returned now rather than being set in obj
(which is then passed to any filters), the filters are not parsed on an unresolved variable.
This changes the behaviour of the default
and default_if_none
filters.
I believe the last line of that patch should have been:
+ obj = settings.TEMPLATE_STRING_IF_INVALID
Perhaps the return None
line should change as well, but it's just used in testing at the moment.
Change History (3)
comment:1 by , 18 years ago
Owner: | changed from | to
---|
comment:2 by , 18 years ago
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Here's the related thread on Google groups