From 942cfe517dc3bd2ae2a01455b152c7f7a6054b3e Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 9 Nov 2023 00:00:18 +0530 Subject: [PATCH] Exclude `external_id` from resources serializers (#1701) * fixes #1687; exclude `external_id` from resources serializers * fix typo --- care/facility/api/serializers/resources.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/care/facility/api/serializers/resources.py b/care/facility/api/serializers/resources.py index 3b5957ed6f..e94cc8f05f 100644 --- a/care/facility/api/serializers/resources.py +++ b/care/facility/api/serializers/resources.py @@ -174,8 +174,8 @@ def create(self, validated_data): class Meta: model = ResourceRequest - exclude = ("deleted",) - read_only_fields = TIMESTAMP_FIELDS + ("external_id",) + exclude = ("deleted", "external_id") + read_only_fields = TIMESTAMP_FIELDS class ResourceRequestCommentSerializer(serializers.ModelSerializer): @@ -195,9 +195,5 @@ def create(self, validated_data): class Meta: model = ResourceRequestComment - exclude = ("deleted", "request") - read_only_fields = TIMESTAMP_FIELDS + ( - "created_by", - "external_id", - "id", - ) + exclude = ("deleted", "request", "external_id") + read_only_fields = TIMESTAMP_FIELDS + ("created_by",)