Clean up how missing end tags are handled in template parsing.

The null token was an artificial placeholder that wasn't making clear what
the problem was. Throwing an exception is bolder.
This commit is contained in:
Gordon P. Hemsley
2016-08-30 18:57:37 -04:00
parent 2e865f03bf
commit 3ffc6b5a35
2 changed files with 8 additions and 9 deletions

View File

@@ -211,16 +211,8 @@ def validate(fn=None, text=None, check_indent=True):
elif kind == 'django_end':
state.matcher(token)
null_token = Token(
kind=None,
s='(NO TAG)',
tag='NO TAG',
line=0,
col=0,
)
if state.depth != 0:
state.matcher(null_token)
raise TemplateParserException('Missing end tag')
def is_special_html_tag(s, tag):
# type: (str, str) -> bool