From 7c5fd7e46209e4b9c764bb0441d84f7f0c49a32e Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 18 Apr 2023 16:54:45 -0600 Subject: [PATCH] Allowing deletion of FileGroup when its files are missing. --- wrolpi/files/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrolpi/files/models.py b/wrolpi/files/models.py index 98a4b147..04bba14a 100644 --- a/wrolpi/files/models.py +++ b/wrolpi/files/models.py @@ -195,7 +195,7 @@ class FileGroup(ModelHelper, Base): raise FileGroupIsTagged(f'Cannot delete {self} because it has tags') for path in self.my_paths(): - path.unlink() + path.unlink(missing_ok=True) if session := Session.object_session(self): session.delete(self)