From a49c44ab44e2394d829de522593a75b161405946 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 26 Apr 2023 11:28:46 +0200 Subject: [PATCH] #328 Fix * fixes bug described in #328 --- intervention/models/revocation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intervention/models/revocation.py b/intervention/models/revocation.py index 3f55bbf4..7d35b84a 100644 --- a/intervention/models/revocation.py +++ b/intervention/models/revocation.py @@ -79,6 +79,10 @@ class RevocationDocument(AbstractDocument): # Remove the file itself super().delete(*args, **kwargs) + if not self.file: + # If (for reasons) no file path has been added to the entry, we act as if the file did not exist + raise ObjectDoesNotExist + # Always remove 'revocation' folder if the one revocation we just processed is the only one left folder_path = self.file.path.split("/") if revoc_docs.count() == 0: -- 2.45.2