HOTFIX: Migrated revocation

* adds handling for error raising if migrated revocation document missing, due to no existing document at all
This commit is contained in:
mpeltriaux 2022-12-14 16:36:21 +01:00
parent 8f89217ac1
commit 5e48202226

View File

@ -87,7 +87,7 @@ class AbstractDocument(BaseResource):
""" """
try: try:
os.remove(self.file.file.name) os.remove(self.file.file.name)
except FileNotFoundError: except (FileNotFoundError, ValueError):
# File seems to missing anyway - continue! # File seems to missing anyway - continue!
pass pass
super().delete(using=using, keep_parents=keep_parents) super().delete(using=using, keep_parents=keep_parents)
@ -113,7 +113,7 @@ class AbstractDocument(BaseResource):
""" """
try: try:
os.remove(self.file.file.name) os.remove(self.file.file.name)
except FileNotFoundError: except (FileNotFoundError, ValueError):
pass pass
self.file = new_file self.file = new_file
self.save() self.save()