diff options
author | Luke Plant <L.Plant.98@cantab.net> | 2011-04-19 22:06:19 +0000 |
---|---|---|
committer | Luke Plant <L.Plant.98@cantab.net> | 2011-04-19 22:06:19 +0000 |
commit | 1286d783110e8b4d1df8068ed0d9093b49cdcaec (patch) | |
tree | 0cbaaad3f19a45763e402988130906678f68f09b /django/template/base.py | |
parent | 9587235530b5e3315e3348b1e0d0899ec5408f6d (diff) | |
download | django-1286d783110e8b4d1df8068ed0d9093b49cdcaec.tar.gz |
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
Diffstat (limited to 'django/template/base.py')
-rw-r--r-- | django/template/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/template/base.py b/django/template/base.py index b8d6c139de..08ff5c6d52 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -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) |