Skip to content

Commit

Permalink
Serialize stakeholder criticality
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 4, 2024
1 parent ce82e67 commit fcb3cdc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/ebios_rm/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"]
Expand All @@ -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__"

0 comments on commit fcb3cdc

Please sign in to comment.