Code

Ticket #3100: patch-breaking-namedendblocks-in-regressiontests-templates.diff

File patch-breaking-namedendblocks-in-regressiontests-templates.diff, 1.1 KB (added by danring, 5 years ago)

patch breaks regressiontests.templates 'namedendblocks0[234]'

Line 
1diff --git a/django/template/__init__.py b/django/template/__init__.py
2index 5493e5b..2f47482 100644
3--- a/django/template/__init__.py
4+++ b/django/template/__init__.py
5@@ -267,14 +267,14 @@ class Parser(object):
6                 var_node = self.create_variable_node(filter_expression)
7                 self.extend_nodelist(nodelist, var_node,token)
8             elif token.token_type == TOKEN_BLOCK:
9-                if token.contents in parse_until:
10-                    # put token back on token list so calling code knows why it terminated
11-                    self.prepend_token(token)
12-                    return nodelist
13                 try:
14                     command = token.contents.split()[0]
15                 except IndexError:
16                     self.empty_block_tag(token)
17+                if command in parse_until:
18+                    # put token back on token list so calling code knows why it terminated
19+                    self.prepend_token(token)
20+                    return nodelist
21                 # execute callback function for this tag and append resulting node
22                 self.enter_command(command, token)
23                 try: