Skip to content

Commit

Permalink
feat: create only selected operational scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Dec 17, 2024
1 parent f41fa84 commit c06b64b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,11 @@ def perform_create(self, serializer):
if instance.ebios_rm_study:
instance.risk_matrix = instance.ebios_rm_study.risk_matrix
ebios_rm_study = EbiosRMStudy.objects.get(id=instance.ebios_rm_study.id)
for operational_scenario in ebios_rm_study.operational_scenarios.all():
for operational_scenario in [
operational_scenario
for operational_scenario in ebios_rm_study.operational_scenarios.all()
if operational_scenario.is_selected
]:
risk_scenario = RiskScenario.objects.create(
risk_assessment=instance,
name=operational_scenario.name,
Expand Down

0 comments on commit c06b64b

Please sign in to comment.