diff --git a/backend/core/views.py b/backend/core/views.py index d7c825dd7..9aeefd33c 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -850,20 +850,21 @@ def duplicate(self, request, pk): residual_impact=scenario.residual_impact, strength_of_knowledge=scenario.strength_of_knowledge, justification=scenario.justification, + ref_id=scenario.ref_id, ) for field in ["applied_controls", "threats", "assets"]: duplicate_related_objects( scenario, duplicate_scenario, - duplicate_risk_assessment.project.folder, + duplicate_risk_assessment.folder, field, ) if ( - duplicate_risk_assessment.project.folder - in [risk_assessment.project.folder] - + risk_assessment.project.folder.sub_folders() + duplicate_risk_assessment.folder + in [risk_assessment.folder] + + [risk for risk in risk_assessment.folder.get_sub_folders()] ): duplicate_scenario.owner.set(scenario.owner.all())