diff --git a/profiles/api/serializers.py b/profiles/api/serializers.py index 4f67dea..2e1a3e3 100644 --- a/profiles/api/serializers.py +++ b/profiles/api/serializers.py @@ -113,7 +113,6 @@ class Meta: class PostalCodeResultSerializer(serializers.ModelSerializer): - result_topic_en = serializers.CharField(source="result.topic_en", read_only=True) postal_code_string = serializers.CharField( source="postal_code.postal_code", read_only=True ) @@ -130,12 +129,16 @@ class Meta: "postal_code_type", "postal_code_type_string", "result", - "result_topic_en", - "count", ] def to_representation(self, instance): representation = super().to_representation(instance) + results_topics = { + "fi": instance.result.value_fi, + "sv": instance.result.value_sv, + "en": instance.result.value_en, + } + representation["result_topics"] = results_topics representation["count"] = blur_count(instance.count) return representation