Skip to content

Commit

Permalink
fix requirement translation regression
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-intuitem committed Dec 12, 2024
1 parent 16f2350 commit ef2078d
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,26 +621,29 @@ class Meta:


class RequirementAssessmentReadSerializer(BaseModelSerializer):
class FilteredNodeSerializer(RequirementNodeReadSerializer):
class Meta:
model = RequirementNode
fields = [
"id",
"urn",
"annotation",
"name",
"description",
"typical_evidence",
"ref_id",
"associated_reference_controls",
"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 = FieldsRelatedField(
[
"id",
"urn",
"annotation",
"name",
"description",
"typical_evidence",
"ref_id",
"associated_reference_controls",
"associated_threats",
"parent_requirement",
]
)
requirement = FilteredNodeSerializer()

class Meta:
model = RequirementAssessment
Expand Down

0 comments on commit ef2078d

Please sign in to comment.