Allowing deletion of FileGroup when its files are missing.

This commit is contained in:
Roland 2023-04-18 16:54:45 -06:00 • committed by lrnselfreliance
parent 8d0f30566f
commit 7c5fd7e462

View file

@ -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)