Ticket #6578: template_simplify.patch
File template_simplify.patch, 887 bytes (added by , 17 years ago) |
---|
-
template/__init__.py
289 289 return NodeList() 290 290 291 291 def extend_nodelist(self, nodelist, node, token): 292 if node.must_be_first and nodelist: 293 try: 294 if nodelist.contains_nontext: 295 raise AttributeError 296 except AttributeError: 297 raise TemplateSyntaxError("%r must be the first tag in the template." % node) 292 if node.must_be_first and nodelist and nodelist.contains_nontext: 293 raise TemplateSyntaxError("%r must be the first tag in the template." % node) 298 294 if isinstance(nodelist, NodeList) and not isinstance(node, TextNode): 299 295 nodelist.contains_nontext = True 300 296 nodelist.append(node)