summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorinondle <qfulsher@gmail.com>2016-05-27 15:12:56 -0700
committerTim Graham <timograham@gmail.com>2016-05-27 18:12:56 -0400
commit93c312cc9cb17ec13ed1957c9a2d2e4ec56b09ed (patch)
treea22519bfa6661326d4c961e83211329dbfdaf0c3 /django
parentff6c6feae17120c2c7df74fb6a9dc76826a1e233 (diff)
Fixed #26573 -- Added descriptive error message for malformed if/else/elif template tags.
Diffstat (limited to 'django')
-rw-r--r--django/template/defaulttags.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 5a972e3a79..41ecd0c7d2 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -969,7 +969,8 @@ def do_if(parser, token):
token = parser.next_token()
# {% endif %}
- assert token.contents == 'endif'
+ if token.contents != 'endif':
+ raise TemplateSyntaxError('Malformed template tag at line {0}: "{1}"'.format(token.lineno, token.contents))
return IfNode(conditions_nodelists)