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:
@@ -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"')
|
||||
|
||||
Reference in New Issue
Block a user