From f71a244d3bd3a2087edc3ba48418a34768fde27f Mon Sep 17 00:00:00 2001 From: Ben Millar Date: Mon, 4 Nov 2024 11:17:11 +0000 Subject: [PATCH] Add disregard_selection EligibilityCheck serializer --- cla_backend/apps/call_centre/serializers.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cla_backend/apps/call_centre/serializers.py b/cla_backend/apps/call_centre/serializers.py index 8854d0c5d..f8272aff9 100644 --- a/cla_backend/apps/call_centre/serializers.py +++ b/cla_backend/apps/call_centre/serializers.py @@ -118,7 +118,7 @@ class Meta(PersonalDetailsSerializerFull.Meta): "safe_to_contact", "vulnerable_user", "has_diversity", - "announce_call" + "announce_call", ) @@ -200,17 +200,18 @@ def validate_property_set(self, value): property_item = super(EligibilityCheckSerializer, self).validate_property_set(value) # Iterate through each item (property) in the property_set list for property_item in value: - if property_item.get('value') is None: + if property_item.get("value") is None: raise serializers.ValidationError("Property 'value' cannot be null.") - if property_item.get('mortgage_left') is None: + if property_item.get("mortgage_left") is None: raise serializers.ValidationError("Property 'mortgage_left' cannot be null.") - if property_item.get('share') is None: + if property_item.get("share") is None: raise serializers.ValidationError("Property 'share' cannot be null.") - if property_item.get('disputed') is None: + if property_item.get("disputed") is None: raise serializers.ValidationError("Property 'disputed' cannot be null.") - if property_item.get('main') is None: + if property_item.get("main") is None: raise serializers.ValidationError("Property 'main' cannot be null.") return value + property_set = PropertySerializer(many=True, required=False) you = PersonSerializer(required=False, allow_null=True) partner = PartnerPersonSerializer(required=False, allow_null=True) @@ -236,6 +237,7 @@ class Meta(EligibilityCheckSerializerBase.Meta): "state", "specific_benefits", "disregards", + "disregard_selection", "has_passported_proceedings_letter", "under_18_passported", "is_you_under_18", @@ -360,7 +362,7 @@ class CreateCaseSerializer(CaseSerializer): """ def create(self, validated_data): - validated_data['gtm_anon_id'] = str(uuid.uuid4()) + validated_data["gtm_anon_id"] = str(uuid.uuid4()) return super(CreateCaseSerializer, self).create(validated_data) personal_details = UUIDSerializer(