From 33a0fc82010fd0d5fc2ebadb785c7f172b5b657d Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Thu, 18 Jul 2024 11:45:56 -0400
Subject: [PATCH] feat: exclude created & updated, and owner IDs field from
 profile serializer for calendar

---
 program/serializers.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/program/serializers.py b/program/serializers.py
index f4224014..056bcdf4 100644
--- a/program/serializers.py
+++ b/program/serializers.py
@@ -1401,9 +1401,24 @@ class CalendarSchemaSerializer(serializers.Serializer):
                 if field not in ["created_at", "created_by", "updated_at", "updated_by"]
             ]
 
+    class CalendarProfileSerializer(ProfileSerializer):
+        class Meta(ProfileSerializer.Meta):
+            fields = [
+                field
+                for field in ProfileSerializer.Meta.fields
+                if field
+                not in [
+                    "created_at",
+                    "created_by",
+                    "owner_ids",
+                    "updated_at",
+                    "updated_by",
+                ]
+            ]
+
     shows = ShowSerializer(many=True)
     timeslots = CalendarTimeslotSerializer(many=True)
-    profiles = ProfileSerializer(many=True)
+    profiles = CalendarProfileSerializer(many=True)
     categories = CategorySerializer(many=True)
     funding_categories = FundingCategorySerializer(many=True)
     types = TypeSerializer(many=True)
-- 
GitLab