summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSrinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>2017-08-16 17:57:59 +0530
committerClaude Paroz <claude@2xlibre.net>2017-08-21 09:04:43 +0200
commit4ead705cb3cf04bb7551ac037d1e11f682b62bcf (patch)
treee47600f5ef0895c1ddf2df57d03d57d601a597f9 /django
parent9229e005aaffc7d3a2015f7a23b1ba1de8d85b63 (diff)
Fixed #28502 -- Made stringformat template filter accept tuples
Diffstat (limited to 'django')
-rw-r--r--django/template/defaultfilters.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index 6dafe70ba5..a1b08e0921 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -224,6 +224,8 @@ def stringformat(value, arg):
for documentation of Python string formatting.
"""
try:
+ if isinstance(value, tuple):
+ return ('%' + str(arg)) % str(value)
return ("%" + str(arg)) % value
except (ValueError, TypeError):
return ""