mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #9756: the for tag no longer leaves the context stack unbalanced when dealing with an empty iterable. Thanks, seanl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -125,6 +125,7 @@ class ForNode(Node):
|
||||
values = list(values)
|
||||
len_values = len(values)
|
||||
if len_values < 1:
|
||||
context.pop()
|
||||
return self.nodelist_empty.render(context)
|
||||
nodelist = NodeList()
|
||||
if self.is_reversed:
|
||||
|
||||
Reference in New Issue
Block a user