From 2f0e0eee450775a71ac3eb42707dcd970ede42c8 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 10 May 2016 12:46:47 -0400 Subject: Fixed #24046 -- Deprecated the "escape" half of utils.safestring. --- django/utils/safestring.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'django/utils') diff --git a/django/utils/safestring.py b/django/utils/safestring.py index 3d3bf1b62a..24a29e0747 100644 --- a/django/utils/safestring.py +++ b/django/utils/safestring.py @@ -4,7 +4,10 @@ without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ +import warnings + from django.utils import six +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.functional import Promise, curry @@ -138,6 +141,7 @@ def mark_for_escaping(s): Can be called multiple times on a single string (the resulting escaping is only applied once). """ + warnings.warn('mark_for_escaping() is deprecated.', RemovedInDjango20Warning) if hasattr(s, '__html__') or isinstance(s, EscapeData): return s if isinstance(s, bytes) or (isinstance(s, Promise) and s._delegate_bytes): -- cgit v1.3