1
0
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:
Tim Graham
2015-03-05 12:38:42 -05:00
parent 88c605e3e3
commit c36b60836b
6 changed files with 36 additions and 10 deletions

View File

@@ -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(",")]