diff options
Diffstat (limited to 'django/forms/forms.py')
| -rw-r--r-- | django/forms/forms.py | 7 |
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 = '' |
