diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-08-22 14:45:08 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-08-22 08:57:50 -0400 |
| commit | dd82f1df556561233eab6a4a2032c2bb306dec87 (patch) | |
| tree | 26e3972fb0895128780aae956125360beb895341 /django | |
| parent | be24b5eaa543bedfc233bff5092b8ca3762e3c70 (diff) | |
[1.11.x] Fixed #28502 -- Made stringformat template filter accept tuples.
Backport of 4ead705cb3cf04bb7551ac037d1e11f682b62bcf and
ed77bea58274e11e5a9e4c8b9650f50deb8a2b26 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaultfilters.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index a1f96f5e2e..bfa6cff668 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -249,6 +249,8 @@ def stringformat(value, arg): See https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting for documentation of Python string formatting. """ + if isinstance(value, tuple): + value = six.text_type(value) try: return ("%" + six.text_type(arg)) % value except (ValueError, TypeError): |
