1
0
mirror of https://github.com/django/django.git synced 2025-10-27 23:56:08 +00:00

Fixed #20649 -- Allowed blank field display to be defined in the initial list of choices.

This commit is contained in:
Alex Couper
2013-07-20 21:49:33 +00:00
committed by Tim Graham
parent a1889397a9
commit 1123f45511
8 changed files with 152 additions and 8 deletions

View File

@@ -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"')