summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMatt Westcott <matt@west.co.tt>2021-08-18 22:11:42 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-08-19 07:39:55 +0200
commit5092f7247de8d3aa2fdb762e50f5ac2aa4e6f6e0 (patch)
tree98727543de14fca7d0f4ec7ebf330befa97b2627 /django
parent231de683d86374c2b74da2185efc6ddfb5eb3341 (diff)
Fixed #33036 -- Made simple_tag()/inclusion_tag() with takes_context raise TemplateSyntaxError when function has no parameters.
Diffstat (limited to 'django')
-rw-r--r--django/template/library.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/template/library.py b/django/template/library.py
index 69fdeafc3b..be45331309 100644
--- a/django/template/library.py
+++ b/django/template/library.py
@@ -243,7 +243,7 @@ def parse_bits(parser, bits, params, varargs, varkw, defaults,
keyword arguments.
"""
if takes_context:
- if params[0] == 'context':
+ if params and params[0] == 'context':
params = params[1:]
else:
raise TemplateSyntaxError(