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__"