#2637: [patch] Filters no longer parsed for unresolved variables
-----------------------------+----------------------------------------------
Reporter: SmileyChris | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Template system | Version:
Severity: normal | Keywords:
-----------------------------+----------------------------------------------
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.
--
Ticket URL: <http://code.djangoproject.com/ticket/2637>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---