This commit is contained in:
mkching 2017-04-27 17:06:40 +00:00 committed by GitHub
commit 748b8e683d

View File

@ -1338,6 +1338,10 @@ class ChoiceField(Field):
super(ChoiceField, self).__init__(**kwargs) super(ChoiceField, self).__init__(**kwargs)
if not self.required:
self.choices[''] = ''
self.choice_strings_to_values[''] = ''
def to_internal_value(self, data): def to_internal_value(self, data):
if data == '' and self.allow_blank: if data == '' and self.allow_blank:
return '' return ''