mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Merge bc736c010a
into 5ba2368ff9
This commit is contained in:
commit
748b8e683d
|
@ -1338,6 +1338,10 @@ class ChoiceField(Field):
|
|||
|
||||
super(ChoiceField, self).__init__(**kwargs)
|
||||
|
||||
if not self.required:
|
||||
self.choices[''] = ''
|
||||
self.choice_strings_to_values[''] = ''
|
||||
|
||||
def to_internal_value(self, data):
|
||||
if data == '' and self.allow_blank:
|
||||
return ''
|
||||
|
|
Loading…
Reference in New Issue
Block a user