From ebfe5a3db2e7fea8c9b28d3f3e9bc093e17c7eec Mon Sep 17 00:00:00 2001 From: Ali Maktabi Date: Thu, 31 Oct 2024 15:47:13 +0330 Subject: [PATCH 1/3] added is_connected to readonly fields --- telegram/serializers.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/telegram/serializers.py b/telegram/serializers.py index 99bb07e..fdc5f4d 100644 --- a/telegram/serializers.py +++ b/telegram/serializers.py @@ -10,9 +10,4 @@ class TelegramConnectionSerializer(BaseThirdPartyConnectionSerializer): class Meta: model = TelegramConnection fields = "__all__" - read_only_fields = [ - "created_on", - "pk", - "user_profile", - "title", - ] + read_only_fields = ["created_on", "pk", "user_profile", "title", "is_connected"] From f5ddb11ae0b4dff8818b933323073b5de3e806ba Mon Sep 17 00:00:00 2001 From: Ali Maktabi Date: Thu, 31 Oct 2024 15:49:03 +0330 Subject: [PATCH 2/3] fixed serializer fields --- telegram/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram/serializers.py b/telegram/serializers.py index fdc5f4d..aebca90 100644 --- a/telegram/serializers.py +++ b/telegram/serializers.py @@ -10,4 +10,4 @@ class TelegramConnectionSerializer(BaseThirdPartyConnectionSerializer): class Meta: model = TelegramConnection fields = "__all__" - read_only_fields = ["created_on", "pk", "user_profile", "title", "is_connected"] + read_only_fields = ["created_at", "pk", "user_profile", "title"] From 12593754b06e36a1f63b09d9bd458a09d41ab76c Mon Sep 17 00:00:00 2001 From: Ali Maktabi Date: Thu, 31 Oct 2024 15:50:04 +0330 Subject: [PATCH 3/3] fixed serializer validation issue --- telegram/serializers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telegram/serializers.py b/telegram/serializers.py index aebca90..f692acf 100644 --- a/telegram/serializers.py +++ b/telegram/serializers.py @@ -11,3 +11,6 @@ class Meta: model = TelegramConnection fields = "__all__" read_only_fields = ["created_at", "pk", "user_profile", "title"] + + def validate_address(self, raise_exception=False): + return True