From fcb3cdc5a1cabb8862e05855db6b84ec4ea5afde Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Wed, 4 Dec 2024 15:25:15 +0100 Subject: [PATCH] Serialize stakeholder criticality --- backend/ebios_rm/serializers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/ebios_rm/serializers.py b/backend/ebios_rm/serializers.py index e19dd2c2a..f60204853 100644 --- a/backend/ebios_rm/serializers.py +++ b/backend/ebios_rm/serializers.py @@ -3,7 +3,7 @@ FieldsRelatedField, ) from core.models import StoredLibrary, RiskMatrix -from .models import EbiosRMStudy, FearedEvent, RoTo +from .models import EbiosRMStudy, FearedEvent, RoTo, Stakeholder from rest_framework import serializers import logging @@ -91,6 +91,9 @@ class Meta: class StakeholderWriteSerializer(BaseModelSerializer): + current_criticality = serializers.IntegerField(read_only=True) + residual_criticality = serializers.IntegerField(read_only=True) + class Meta: model = Stakeholder exclude = ["created_at", "updated_at", "folder"] @@ -103,6 +106,9 @@ class StakeholderReadSerializer(BaseModelSerializer): entity = FieldsRelatedField() applied_controls = FieldsRelatedField(many=True) + current_criticality = serializers.IntegerField() + residual_criticality = serializers.IntegerField() + class Meta: model = Stakeholder fields = "__all__"