From f11ac5d3be646b08b815f9afc1fe16f6282a6083 Mon Sep 17 00:00:00 2001 From: imperosol Date: Mon, 26 Oct 2026 22:55:34 +0100 Subject: [PATCH] fix: arbitrary file suppression --- core/views/files.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/views/files.py b/core/views/files.py index 8b7b4f42..a68f5963 100644 --- a/core/views/files.py +++ b/core/views/files.py @@ -269,7 +269,7 @@ class FileView(CanViewMixin, DetailView, FormMixin): form_class = AddFilesForm @staticmethod - def handle_clipboard(request, obj): + def handle_clipboard(request, obj: SithFile): """Handle the clipboard in the view. This method can fail, since it does not catch the exceptions coming from @@ -283,10 +283,9 @@ class FileView(CanViewMixin, DetailView, FormMixin): where you want to paste the clipboard """ if "delete" in request.POST: - for f_id in request.POST.getlist("file_list"): - file = SithFile.objects.filter(id=f_id).first() - if file: - file.delete() + file_ids = request.POST.getlist("file_list") + for file in obj.children.filter(id__in=file_ids): + file.delete() if "clear" in request.POST: request.session["clipboard"] = [] if "cut" in request.POST: