summaryrefslogtreecommitdiff
path: root/django/contrib/admin/helpers.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-12-31 08:26:23 -0500
committerTim Graham <timograham@gmail.com>2017-01-17 20:52:01 -0500
commitd67a46e10459858b681176a3e1f8c6bca39d2ac7 (patch)
tree6684f940e9961299d9520710e1fe16187194d0f9 /django/contrib/admin/helpers.py
parent7510b872e7a2c06e935b0469813320a65f679f64 (diff)
Refs #25135 -- Removed support for the contrib.admin allow_tags attribute.
Per deprecation timeline.
Diffstat (limited to 'django/contrib/admin/helpers.py')
-rw-r--r--django/contrib/admin/helpers.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
index cbe03031a9..604fcd5b26 100644
--- a/django/contrib/admin/helpers.py
+++ b/django/contrib/admin/helpers.py
@@ -1,7 +1,6 @@
from __future__ import unicode_literals
import json
-import warnings
from django import forms
from django.conf import settings
@@ -14,7 +13,6 @@ from django.db.models.fields.related import ManyToManyRel
from django.forms.utils import flatatt
from django.template.defaultfilters import capfirst, linebreaksbr
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_text
from django.utils.html import conditional_escape, format_html
from django.utils.safestring import mark_safe
@@ -218,17 +216,7 @@ class AdminReadonlyField(object):
if hasattr(value, "__html__"):
result_repr = value
else:
- result_repr = force_text(value)
- if getattr(attr, "allow_tags", False):
- warnings.warn(
- "Deprecated allow_tags attribute used on %s. "
- "Use django.utils.html.format_html(), format_html_join(), "
- "or django.utils.safestring.mark_safe() instead." % attr,
- RemovedInDjango20Warning
- )
- result_repr = mark_safe(value)
- else:
- result_repr = linebreaksbr(result_repr)
+ result_repr = linebreaksbr(force_text(value))
else:
if isinstance(f.remote_field, ManyToManyRel) and value is not None:
result_repr = ", ".join(map(six.text_type, value.all()))