diff --git a/apps/common/serializers/fields.py b/apps/common/serializers/fields.py index b3b4cd925..e53faeb9d 100644 --- a/apps/common/serializers/fields.py +++ b/apps/common/serializers/fields.py @@ -110,6 +110,11 @@ class LabelRelatedField(serializers.RelatedField): kwargs["queryset"] = queryset super().__init__(**kwargs) + def to_file_representation(self, value): + if value is None: + return value + return "{}:{}".format(value.get('name'), value.get('value')) + def to_representation(self, value): if value is None: return value