This commit is contained in:
Jeremy Stretch 2023-09-26 12:06:10 -04:00
parent 2a9b58925c
commit b36f2ba1c9

View File

@ -49,10 +49,9 @@ class ChoiceField(serializers.Field):
if obj != '':
# Use an empty string in place of the choice label if it cannot be resolved (i.e. because a previously
# configured choice has been removed from FIELD_CHOICES).
label = self._choices.get(obj, '')
return {
'value': obj,
'label': label,
'label': self._choices.get(obj, ''),
}
def to_internal_value(self, data):