diff --git a/apps/common/serializers/fields.py b/apps/common/serializers/fields.py index 4627af85e..282394106 100644 --- a/apps/common/serializers/fields.py +++ b/apps/common/serializers/fields.py @@ -66,10 +66,9 @@ class LabeledChoiceField(ChoiceField): def to_internal_value(self, data): if isinstance(data, dict): data = data.get("value") - if "(" in data and data.endswith(")"): - d = data.strip(")").split('(')[-1] - if d in self.choices: - data = d + + if isinstance(data, str) and "(" in data and data.endswith(")"): + data = data.strip(")").split('(')[-1] return super(LabeledChoiceField, self).to_internal_value(data)