mirror of
https://github.com/django/django.git
synced 2025-11-18 11:00:24 +00:00
Replaced smart_* by force_* calls whenever possible
The smart_* version should only be used when a lazy string should keep its lazy status.
This commit is contained in:
parent
b1d6b0a7b1
commit
2ced2f785d
23 changed files with 60 additions and 63 deletions
|
|
@ -15,7 +15,7 @@ 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, smart_text
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.html import conditional_escape, format_html
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
||||
|
|
@ -209,7 +209,7 @@ class AdminReadonlyField(object):
|
|||
if hasattr(value, "__html__"):
|
||||
result_repr = value
|
||||
else:
|
||||
result_repr = smart_text(value)
|
||||
result_repr = force_text(value)
|
||||
if getattr(attr, "allow_tags", False):
|
||||
warnings.warn(
|
||||
"Deprecated allow_tags attribute used on %s. "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue