From df0aebc893973c78d7d2cda712ba4133dbe29b6e Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 5 Oct 2017 11:38:39 -0400 Subject: [PATCH] Simplified IfNode.nodelist --- django/template/defaulttags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 9c7d941126..1101c20003 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -292,7 +292,7 @@ class IfNode(Node): @property def nodelist(self): - return NodeList(node for _, nodelist in self.conditions_nodelists for node in nodelist) + return NodeList(iter(self)) def render(self, context): for condition, nodelist in self.conditions_nodelists: