From 41444b0fb3c4c6b2778e2bec6b8c0bcde19fef2b Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Fri, 29 Nov 2024 21:51:31 +0530 Subject: [PATCH 1/4] Added Emergency Number UserBaseMinimumSerializer --- care/users/api/serializers/user.py | 1 + 1 file changed, 1 insertion(+) diff --git a/care/users/api/serializers/user.py b/care/users/api/serializers/user.py index c33a004bdf..301b2cfb2d 100644 --- a/care/users/api/serializers/user.py +++ b/care/users/api/serializers/user.py @@ -388,6 +388,7 @@ class Meta: "user_type", "last_login", "read_profile_picture_url", + "alt_phone_number" ) From 3e5a031683cbc497c6b2a88624a110875a869468 Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Wed, 4 Dec 2024 17:49:27 +0530 Subject: [PATCH 2/4] Added phone_number in place of alt_phone_number --- 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 301b2cfb2d..a7288c2761 100644 --- a/care/users/api/serializers/user.py +++ b/care/users/api/serializers/user.py @@ -388,7 +388,7 @@ class Meta: "user_type", "last_login", "read_profile_picture_url", - "alt_phone_number" + "phone_number" ) From 3542291a048f9d9d640919edadc26d442e66a20f Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Wed, 4 Dec 2024 17:55:58 +0530 Subject: [PATCH 3/4] Added phone_number in place of alt_phone_number --- 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 a7288c2761..4ed04c3acd 100644 --- a/care/users/api/serializers/user.py +++ b/care/users/api/serializers/user.py @@ -388,7 +388,7 @@ class Meta: "user_type", "last_login", "read_profile_picture_url", - "phone_number" + "phone_number", ) From dce3af6cb5b20f3f5f853a3da012567b9cfb92d3 Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Sat, 28 Dec 2024 12:38:41 +0530 Subject: [PATCH 4/4] Used UserAssignedSerializer instead of UserBaseMinimumSerializer --- care/facility/api/serializers/patient.py | 6 +++--- care/users/api/serializers/user.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/care/facility/api/serializers/patient.py b/care/facility/api/serializers/patient.py index 926e9b21bb..fa2a18a8d4 100644 --- a/care/facility/api/serializers/patient.py +++ b/care/facility/api/serializers/patient.py @@ -40,7 +40,7 @@ StateSerializer, WardSerializer, ) -from care.users.api.serializers.user import UserBaseMinimumSerializer +from care.users.api.serializers.user import UserAssignedSerializer, UserBaseMinimumSerializer from care.users.models import User from care.utils.notification_handler import NotificationGenerator from care.utils.queryset.facility import get_home_facility_queryset @@ -86,7 +86,7 @@ class PatientListSerializer(serializers.ModelSerializer): ) source = ChoiceField(choices=PatientRegistration.SourceChoices) - assigned_to_object = UserBaseMinimumSerializer(source="assigned_to", read_only=True) + assigned_to_object = UserAssignedSerializer(source="assigned_to", read_only=True) class Meta: model = PatientRegistration @@ -167,7 +167,7 @@ class MedicalHistorySerializer(serializers.Serializer): choices=PatientRegistration.VaccineChoices, required=False, allow_null=True ) - assigned_to_object = UserBaseMinimumSerializer(source="assigned_to", read_only=True) + assigned_to_object = UserAssignedSerializer(source="assigned_to", read_only=True) assigned_to = serializers.PrimaryKeyRelatedField( queryset=User.objects.all(), required=False, allow_null=True diff --git a/care/users/api/serializers/user.py b/care/users/api/serializers/user.py index 4ed04c3acd..c33a004bdf 100644 --- a/care/users/api/serializers/user.py +++ b/care/users/api/serializers/user.py @@ -388,7 +388,6 @@ class Meta: "user_type", "last_login", "read_profile_picture_url", - "phone_number", )