mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +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:
@@ -5,9 +5,7 @@ import datetime
|
||||
from django.forms.utils import flatatt, pretty_name
|
||||
from django.forms.widgets import Textarea, TextInput
|
||||
from django.utils import six
|
||||
from django.utils.encoding import (
|
||||
force_text, python_2_unicode_compatible, smart_text,
|
||||
)
|
||||
from django.utils.encoding import force_text, python_2_unicode_compatible
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.html import conditional_escape, format_html, html_safe
|
||||
from django.utils.safestring import mark_safe
|
||||
@@ -196,8 +194,8 @@ class BoundField(object):
|
||||
associated Form has specified auto_id. Returns an empty string otherwise.
|
||||
"""
|
||||
auto_id = self.form.auto_id
|
||||
if auto_id and '%s' in smart_text(auto_id):
|
||||
return smart_text(auto_id) % self.html_name
|
||||
if auto_id and '%s' in force_text(auto_id):
|
||||
return force_text(auto_id) % self.html_name
|
||||
elif auto_id:
|
||||
return self.html_name
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user