Skip to content

Commit

Permalink
Replace the sub_folders usage with get_sub_folders
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Oct 21, 2024
1 parent 4d2038a commit 15ed2bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ def duplicate_and_link_object(new_obj, duplicate_object, target_folder, field_na

# Get parent and sub-folders of the target folder
target_parent_folders = target_folder.get_parent_folders()
sub_folders = target_folder.sub_folders()
sub_folders = target_folder.get_sub_folders()

# Get all related objects for the specified field
related_objects = getattr(source_object, field_name).all()
Expand Down
5 changes: 3 additions & 2 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,9 @@ def duplicate(self, request, pk):

if (
duplicate_risk_assessment.project.folder
in [risk_assessment.project.folder]
+ risk_assessment.project.folder.sub_folders()
== risk_assessment.project.folder
or duplicate_risk_assessment.project.folder
in risk_assessment.project.folder.get_sub_folders()
):
duplicate_scenario.owner.set(scenario.owner.all())

Expand Down

0 comments on commit 15ed2bb

Please sign in to comment.