diff options
| author | Jirka Vejrazka <Jirka.Vejrazka@gmail.com> | 2018-04-04 20:03:16 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-04-04 14:03:16 -0400 |
| commit | 6148dda72f47e40754fc2eb75d86274fb68f2d41 (patch) | |
| tree | ad9ed9efe7475fde98481df7ab367b39eec5be2a /django | |
| parent | 9fd9f8bbb23407254aa0ba851dbcc8e7f696c3de (diff) | |
Fixed #29288 -- Made {% widthratio %} assign to as var if an exception occurs.
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaulttags.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 6e52249584..43c557f179 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -483,9 +483,9 @@ class WidthRatioNode(Node): ratio = (value / max_value) * max_width result = str(round(ratio)) except ZeroDivisionError: - return '0' + result = '0' except (ValueError, TypeError, OverflowError): - return '' + result = '' if self.asvar: context[self.asvar] = result |
