mirror of
https://github.com/django/django.git
synced 2025-11-13 17:09:28 +00:00
Fixed #24451 -- Deprecated comma-separated {% cycle %} syntax.
This commit is contained in:
parent
88c605e3e3
commit
c36b60836b
6 changed files with 36 additions and 10 deletions
|
|
@ -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(",")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue