From 10f2edd6cc926ae4ecab5bb259334d1779c95075 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Tue, 23 Apr 2024 22:16:19 +0530 Subject: [PATCH] Remove defining `date_of_birth` and `year_of_birth` serializer fields (#2112) * fixes https://github.com/coronasafe/care_fe/issues/7693 * update tests --- care/facility/api/serializers/patient.py | 3 --- care/facility/models/tests/test_patient.py | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/care/facility/api/serializers/patient.py b/care/facility/api/serializers/patient.py index b38cc60993..f526db1b73 100644 --- a/care/facility/api/serializers/patient.py +++ b/care/facility/api/serializers/patient.py @@ -218,9 +218,6 @@ class Meta: ) abha_number_object = AbhaNumberSerializer(source="abha_number", read_only=True) - date_of_birth = serializers.DateField(required=False, allow_null=True) - year_of_birth = serializers.IntegerField(default=0) - class Meta: model = PatientRegistration exclude = ( diff --git a/care/facility/models/tests/test_patient.py b/care/facility/models/tests/test_patient.py index 00f7e5e7df..ab403e61a3 100644 --- a/care/facility/models/tests/test_patient.py +++ b/care/facility/models/tests/test_patient.py @@ -35,6 +35,7 @@ def test_date_of_birth_validation(self): "blood_group": "AB+", "gender": 1, "date_of_birth": now().date() + timedelta(days=365), + "year_of_birth": None, "disease_status": "NEGATIVE", "emergency_phone_number": "+919000000666", "is_vaccinated": "false", @@ -52,6 +53,7 @@ def test_year_of_birth_validation(self): "facility": self.facility.external_id, "blood_group": "AB+", "gender": 1, + "date_of_birth": None, "year_of_birth": now().year + 1, "disease_status": "NEGATIVE", "emergency_phone_number": "+919000000666",