summaryrefslogtreecommitdiff
path: root/django/forms/forms.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2017-04-21 19:52:26 +0200
committerClaude Paroz <claude@2xlibre.net>2017-04-27 09:10:02 +0200
commit301de774c21d055e9e5a7073e5bffdb52bc71079 (patch)
tree4c0c65fd147d528cce920cbd6a16ffa493d832ca /django/forms/forms.py
parent8ab7ce8558792f41637d6f87f2a8a117e169dd18 (diff)
Refs #27795 -- Replaced many force_text() with str()
Thanks Tim Graham for the review.
Diffstat (limited to 'django/forms/forms.py')
-rw-r--r--django/forms/forms.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/django/forms/forms.py b/django/forms/forms.py
index 80613570ad..e2e7c645ff 100644
--- a/django/forms/forms.py
+++ b/django/forms/forms.py
@@ -12,7 +12,6 @@ from django.forms.fields import Field, FileField
# pretty_name is imported for backwards compatibility in Django 1.9
from django.forms.utils import ErrorDict, ErrorList, pretty_name # NOQA
from django.forms.widgets import Media, MediaDefiningClass
-from django.utils.encoding import force_text
from django.utils.functional import cached_property
from django.utils.html import conditional_escape, html_safe
from django.utils.safestring import mark_safe
@@ -205,7 +204,7 @@ class BaseForm:
if bf.is_hidden:
if bf_errors:
top_errors.extend(
- [_('(Hidden field %(name)s) %(error)s') % {'name': name, 'error': force_text(e)}
+ [_('(Hidden field %(name)s) %(error)s') % {'name': name, 'error': str(e)}
for e in bf_errors])
hidden_fields.append(str(bf))
else:
@@ -216,10 +215,10 @@ class BaseForm:
html_class_attr = ' class="%s"' % css_classes
if errors_on_separate_row and bf_errors:
- output.append(error_row % force_text(bf_errors))
+ output.append(error_row % str(bf_errors))
if bf.label:
- label = conditional_escape(force_text(bf.label))
+ label = conditional_escape(bf.label)
label = bf.label_tag(label) or ''
else:
label = ''