Ticket #8296: 8296.diff

File 8296.diff, 1.2 KB (added by Andy Durdin, 15 years ago)

Slightly more robust patch.

  • django/template/__init__.py

     
    267267                var_node = self.create_variable_node(filter_expression)
    268268                self.extend_nodelist(nodelist, var_node,token)
    269269            elif token.token_type == TOKEN_BLOCK:
    270                 if token.contents in parse_until:
    271                     # put token back on token list so calling code knows why it terminated
    272                     self.prepend_token(token)
    273                     return nodelist
    274270                try:
    275271                    command = token.contents.split()[0]
    276272                except IndexError:
    277273                    self.empty_block_tag(token)
     274                if command in parse_until:
     275                    # put token back on token list so calling code knows why it terminated
     276                    self.prepend_token(token)
     277                    return nodelist
    278278                # execute callback function for this tag and append resulting node
    279279                self.enter_command(command, token)
    280280                try:
Back to Top