Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Oct 21, 2024
1 parent dc80e5b commit b6cf0f9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
11 changes: 0 additions & 11 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,17 +1248,6 @@ def get_size(self):
else:
return f"{size / 1024 / 1024:.1f} MB"

def duplicate_into_folder(self, folder: Folder) -> Self:
duplicated_evidence = Evidence(
folder=folder,
name=self.name,
description=self.description,
attachment=self.attachment,
link=self.link,
)
duplicated_evidence.save()
return duplicated_evidence


class AppliedControl(NameDescriptionMixin, FolderMixin, PublishInRootFolderMixin):
class Status(models.TextChoices):
Expand Down
2 changes: 1 addition & 1 deletion backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ def duplicate(self, request, pk):
effort=applied_control.effort,
cost=applied_control.cost,
)
if request.data["duplicate_evidences"]:
if data["duplicate_evidences"]:
duplicate_related_objects(
applied_control, duplicate_applied_control, new_folder, "evidences"
)
Expand Down
10 changes: 0 additions & 10 deletions backend/iam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ def get_parent_folders(self) -> Generator[Self, None, None]:
while (current_folder := current_folder.parent_folder) is not None:
yield current_folder

# Is this function usefull ?
def can_access(self, folder: Self) -> bool:
return (
self == folder
or any(
folder == parent_folder for parent_folder in self.get_parent_folders()
)
or any(folder == sub_folder for sub_folder in self.get_sub_folders())
)

@staticmethod
def _navigate_structure(start, path):
"""
Expand Down

0 comments on commit b6cf0f9

Please sign in to comment.