mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #15791 - method to signal that callable objects should not be called in templates
Thanks to ejucovy for the suggestion and patch! git-svn-id: http://code.djangoproject.com/svn/django/trunk@16045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -692,7 +692,9 @@ class Variable(object):
|
||||
):
|
||||
raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute
|
||||
if callable(current):
|
||||
if getattr(current, 'alters_data', False):
|
||||
if getattr(current, 'do_not_call_in_templates', False):
|
||||
pass
|
||||
elif getattr(current, 'alters_data', False):
|
||||
current = settings.TEMPLATE_STRING_IF_INVALID
|
||||
else:
|
||||
try: # method call (assuming no args required)
|
||||
|
||||
Reference in New Issue
Block a user