From 5e48202226ecb02ac197abae6f0e99cb541cece4 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 14 Dec 2022 16:36:21 +0100 Subject: [PATCH] HOTFIX: Migrated revocation * adds handling for error raising if migrated revocation document missing, due to no existing document at all --- konova/models/document.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/konova/models/document.py b/konova/models/document.py index b465d70c..70ff3d79 100644 --- a/konova/models/document.py +++ b/konova/models/document.py @@ -87,7 +87,7 @@ class AbstractDocument(BaseResource): """ try: os.remove(self.file.file.name) - except FileNotFoundError: + except (FileNotFoundError, ValueError): # File seems to missing anyway - continue! pass super().delete(using=using, keep_parents=keep_parents) @@ -113,7 +113,7 @@ class AbstractDocument(BaseResource): """ try: os.remove(self.file.file.name) - except FileNotFoundError: + except (FileNotFoundError, ValueError): pass self.file = new_file - self.save() \ No newline at end of file + self.save()