Skip to content

Commit

Permalink
Avoid repetition
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Oct 17, 2024
1 parent 4ceed7c commit 82ba211
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,24 +636,13 @@ def duplicate(self, request, pk):
justification=scenario.justification,
)

duplicate_related_objects(
scenario,
duplicate_scenario,
duplicate_risk_assessment.project.folder,
"applied_controls",
)
duplicate_related_objects(
scenario,
duplicate_scenario,
duplicate_risk_assessment.project.folder,
"threats",
)
duplicate_related_objects(
scenario,
duplicate_scenario,
duplicate_risk_assessment.project.folder,
"assets",
)
for field in ["applied_controls", "threats", "assets"] :
duplicate_related_objects(
scenario,
duplicate_scenario,
duplicate_risk_assessment.project.folder,
field,
)

if (
duplicate_risk_assessment.project.folder
Expand Down

0 comments on commit 82ba211

Please sign in to comment.