summaryrefslogtreecommitdiff
path: root/django/forms/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms/widgets.py')
-rw-r--r--django/forms/widgets.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 04f800785b..2feded85c7 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -12,7 +12,6 @@ from django.forms.utils import to_current_timezone
from django.templatetags.static import static
from django.utils import datetime_safe, formats
from django.utils.dates import MONTHS
-from django.utils.encoding import force_text
from django.utils.formats import get_format
from django.utils.html import format_html, html_safe
from django.utils.safestring import mark_safe
@@ -184,7 +183,7 @@ class Widget(metaclass=MediaDefiningClass):
return None
if self.is_localized:
return formats.localize_input(value)
- return force_text(value)
+ return str(value)
def get_context(self, name, value, attrs):
context = {}
@@ -483,7 +482,7 @@ class CheckboxInput(Input):
"""Only return the 'value' attribute if value isn't empty."""
if value is True or value is False or value is None or value == '':
return
- return force_text(value)
+ return str(value)
def get_context(self, name, value, attrs):
if self.check_test(value):
@@ -570,7 +569,7 @@ class ChoiceWidget(Widget):
for subvalue, sublabel in choices:
selected = (
- force_text(subvalue) in value and
+ str(subvalue) in value and
(not has_selected or self.allow_multiple_selected)
)
if selected and not has_selected: