From edeca1cf3a24d4981e992230c34988b3fbd48a3e Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 5 Nov 2024 11:13:48 +0530 Subject: [PATCH 1/3] adding profile pic url to UserBaseMinSerializer --- care/users/api/serializers/user.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/care/users/api/serializers/user.py b/care/users/api/serializers/user.py index 36141cecdd..cb7e6f9a89 100644 --- a/care/users/api/serializers/user.py +++ b/care/users/api/serializers/user.py @@ -375,6 +375,7 @@ def validate(self, attrs): class UserBaseMinimumSerializer(serializers.ModelSerializer): user_type = ChoiceField(choices=User.TYPE_CHOICES, read_only=True) + read_profile_picture_url = serializers.URLField(read_only=True) class Meta: model = User @@ -386,6 +387,7 @@ class Meta: "last_name", "user_type", "last_login", + "read_profile_picture_url" ) From 33a8c43fc690c902b6e3af6209d12fb086f13e7f Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 5 Nov 2024 11:26:20 +0530 Subject: [PATCH 2/3] formatting fix --- care/users/api/serializers/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/care/users/api/serializers/user.py b/care/users/api/serializers/user.py index cb7e6f9a89..c33a004bdf 100644 --- a/care/users/api/serializers/user.py +++ b/care/users/api/serializers/user.py @@ -387,7 +387,7 @@ class Meta: "last_name", "user_type", "last_login", - "read_profile_picture_url" + "read_profile_picture_url", ) From a8a4268e14e6ef96e03d6a44d7fc73bd611e31aa Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 5 Nov 2024 11:50:04 +0530 Subject: [PATCH 3/3] test fix --- care/facility/tests/test_patient_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/care/facility/tests/test_patient_api.py b/care/facility/tests/test_patient_api.py index 01bff0b813..6facfdd3ad 100644 --- a/care/facility/tests/test_patient_api.py +++ b/care/facility/tests/test_patient_api.py @@ -86,6 +86,7 @@ class ExpectedCreatedByObjectKeys(Enum): LAST_NAME = "last_name" USER_TYPE = "user_type" LAST_LOGIN = "last_login" + READ_PROFILE_PICTURE_URL = "read_profile_picture_url" class PatientNotesTestCase(TestUtils, APITestCase):