Delete the source only when it was found

This commit is contained in:
tcely 2025-03-28 00:26:33 -04:00 committed by GitHub
parent 4303237b14
commit 78bd153158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -792,6 +792,7 @@ def delete_all_media_for_source(source_id, source_name, source_directory):
(source and source.delete_removed_media) or
(directory_path / '.to_be_removed').is_file()
)
if source:
with atomic(durable=True):
source.delete()
if remove: