diff options
| author | Alex Couper <alex.couper@glassesdirect.com> | 2013-07-20 21:49:33 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-31 14:12:03 -0400 |
| commit | 1123f4551158b7fc65d3bd88c375a4517dcd0720 (patch) | |
| tree | cfded236931c3360205bf35351d81c75a78ef743 /django/forms/widgets.py | |
| parent | a1889397a9f0e6a35189de455098b4c70923e561 (diff) | |
Fixed #20649 -- Allowed blank field display to be defined in the initial list of choices.
Diffstat (limited to 'django/forms/widgets.py')
| -rw-r--r-- | django/forms/widgets.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py index 8a351bb637..784ccda159 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -511,6 +511,8 @@ class Select(Widget): return mark_safe('\n'.join(output)) def render_option(self, selected_choices, option_value, option_label): + if option_value == None: + option_value = '' option_value = force_text(option_value) if option_value in selected_choices: selected_html = mark_safe(' selected="selected"') |
