summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
Diffstat (limited to 'django/template')
-rw-r--r--django/template/defaultfilters.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index c857a0e0a3..d4bed6898d 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -518,11 +518,11 @@ def first(value):
@register.filter(is_safe=True, needs_autoescape=True)
def join(value, arg, autoescape=True):
"""Join a list with a string, like Python's ``str.join(list)``."""
- if autoescape:
- value = [conditional_escape(v) for v in value]
try:
+ if autoescape:
+ value = [conditional_escape(v) for v in value]
data = conditional_escape(arg).join(value)
- except AttributeError: # fail silently but nicely
+ except TypeError: # Fail silently if arg isn't iterable.
return value
return mark_safe(data)