From d0bfb4d7a99171ecaf14d19dab1ec62512661f08 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Thu, 12 Dec 2024 01:15:00 +0100 Subject: [PATCH] fix requirement translation regression fix requirement translation regression --- backend/core/serializers.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/backend/core/serializers.py b/backend/core/serializers.py index 0e3c95ae77..874a125031 100644 --- a/backend/core/serializers.py +++ b/backend/core/serializers.py @@ -621,14 +621,11 @@ class Meta: class RequirementAssessmentReadSerializer(BaseModelSerializer): - name = serializers.CharField(source="__str__") - description = serializers.CharField(source="get_requirement_description") - evidences = FieldsRelatedField(many=True) - compliance_assessment = FieldsRelatedField() - folder = FieldsRelatedField() - assessable = serializers.BooleanField(source="requirement.assessable") - requirement = FieldsRelatedField( - [ + + class FilteredNodeSerializer(RequirementNodeReadSerializer): + class Meta: + model = RequirementNode + fields = [ "id", "urn", "annotation", @@ -640,7 +637,14 @@ class RequirementAssessmentReadSerializer(BaseModelSerializer): "associated_threats", "parent_requirement", ] - ) + + name = serializers.CharField(source="__str__") + description = serializers.CharField(source="get_requirement_description") + evidences = FieldsRelatedField(many=True) + compliance_assessment = FieldsRelatedField() + folder = FieldsRelatedField() + assessable = serializers.BooleanField(source="requirement.assessable") + requirement = FilteredNodeSerializer() class Meta: model = RequirementAssessment