diff options
author | Tim Graham <timograham@gmail.com> | 2016-08-31 13:44:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 13:44:38 -0400 |
commit | 59afe61a970dd60df388e7cda9041ef3c0e770cb (patch) | |
tree | b5741f718e50a7fca8f6d1d54db46078ce9630da /django | |
parent | 65ec8fa8ca56a5378345375e1079025c96d0b833 (diff) | |
download | django-59afe61a970dd60df388e7cda9041ef3c0e770cb.tar.gz |
Fixed #27140 -- Prevented template rendering from hiding a property's TypeError.
Diffstat (limited to 'django')
-rw-r--r-- | django/template/base.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/template/base.py b/django/template/base.py index d97ee81326..778d82be55 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -892,9 +892,8 @@ class Variable(object): raise AttributeError current = getattr(current, bit) except (TypeError, AttributeError) as e: - # Reraise an AttributeError raised by a @property - if (isinstance(e, AttributeError) and - not isinstance(current, BaseContext) and bit in dir(current)): + # Reraise if the exception was raised by a @property + if not isinstance(current, BaseContext) and bit in dir(current): raise try: # list-index lookup current = current[int(bit)] |