mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #24451 -- Deprecated comma-separated {% cycle %} syntax.
This commit is contained in:
@@ -654,6 +654,10 @@ def cycle(parser, token):
|
||||
raise TemplateSyntaxError("'cycle' tag requires at least two arguments")
|
||||
|
||||
if ',' in args[1]:
|
||||
warnings.warn(
|
||||
"The old {% cycle %} syntax with comma-separated arguments is deprecated.",
|
||||
RemovedInDjango20Warning,
|
||||
)
|
||||
# Backwards compatibility: {% cycle a,b %} or {% cycle a,b as foo %}
|
||||
# case.
|
||||
args[1:2] = ['"%s"' % arg for arg in args[1].split(",")]
|
||||
|
||||
Reference in New Issue
Block a user