diff options
| author | Jaap Roes <jaap@eight.nl> | 2014-08-11 09:51:52 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-11 07:04:33 -0400 |
| commit | e92b057e06b41eb05930637119e83ed3acd3d324 (patch) | |
| tree | 9966e66c8b7c8148cfa0cb3937a45c7be61c4854 /django | |
| parent | 2e7be92b4df29ac851d570e57da5dcf756c5ac52 (diff) | |
Fixed #23261 -- Deprecated old style list support for unordered_list filter.
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaultfilters.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index c5839197df..f63f11a057 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -6,11 +6,13 @@ import random as random_module from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP from functools import wraps from pprint import pformat +import warnings from django.template.base import Variable, Library, VariableDoesNotExist from django.conf import settings from django.utils import formats from django.utils.dateformat import format, time_format +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_text, iri_to_uri from django.utils.html import (conditional_escape, escapejs, escape, urlize as _urlize, linebreaks, strip_tags, avoid_wrapping, @@ -705,6 +707,11 @@ def unordered_list(value, autoescape=None): i += 1 return '\n'.join(output) value, converted = convert_old_style_list(value) + if converted: + warnings.warn( + "The old style syntax in `unordered_list` is deprecated and will " + "be removed in Django 2.0. Use the the new format instead.", + RemovedInDjango20Warning) return mark_safe(_helper(value)) |
