diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 1101c20003..212aa8987a 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -292,7 +292,7 @@ class IfNode(Node): @property def nodelist(self): - return NodeList(iter(self)) + return NodeList(self) def render(self, context): for condition, nodelist in self.conditions_nodelists: