mirror of
https://github.com/django/django.git
synced 2025-10-30 17:16:10 +00:00
Fixed #12965 - unordered_list template filter fails when given a non-iterable second item in a two item list
Thanks to grahamu for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -601,6 +601,10 @@ def unordered_list(value, autoescape=None):
|
||||
first_item, second_item = list_
|
||||
if second_item == []:
|
||||
return [first_item], True
|
||||
try:
|
||||
it = iter(second_item) # see if second item is iterable
|
||||
except TypeError:
|
||||
return list_, False
|
||||
old_style_list = True
|
||||
new_second_item = []
|
||||
for sublist in second_item:
|
||||
|
||||
Reference in New Issue
Block a user