summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/templates/django/forms/widgets/input.html2
-rw-r--r--django/forms/templates/django/forms/widgets/select_option.html2
-rw-r--r--django/forms/widgets.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/django/forms/templates/django/forms/widgets/input.html b/django/forms/templates/django/forms/widgets/input.html
index abbdf6bd26..5feef43c55 100644
--- a/django/forms/templates/django/forms/widgets/input.html
+++ b/django/forms/templates/django/forms/widgets/input.html
@@ -1 +1 @@
-<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} />
+<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} />
diff --git a/django/forms/templates/django/forms/widgets/select_option.html b/django/forms/templates/django/forms/widgets/select_option.html
index c6355f69dd..8d31961dd3 100644
--- a/django/forms/templates/django/forms/widgets/select_option.html
+++ b/django/forms/templates/django/forms/widgets/select_option.html
@@ -1 +1 @@
-<option value="{{ widget.value }}"{% include "django/forms/widgets/attrs.html" %}>{{ widget.label }}</option>
+<option value="{{ widget.value|stringformat:'s' }}"{% include "django/forms/widgets/attrs.html" %}>{{ widget.label }}</option>
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 5b47aa691d..282ba0b481 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -591,7 +591,7 @@ class ChoiceWidget(Widget):
option_attrs['id'] = self.id_for_label(option_attrs['id'], index)
return {
'name': name,
- 'value': str(value),
+ 'value': value,
'label': label,
'selected': selected,
'index': index,