mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
Account for thumbnail deletion as well
This commit is contained in:
parent
f5daded930
commit
3bbcd562fc
2 changed files with 9 additions and 5 deletions
|
|
@ -85,7 +85,8 @@ def run_post_consume_script(sender, document, **kwargs):
|
|||
|
||||
|
||||
def cleanup_document_deletion(sender, instance, using, **kwargs):
|
||||
try:
|
||||
os.unlink(instance.source_path)
|
||||
except FileNotFoundError:
|
||||
pass # The file's already gone, so we're cool with it.
|
||||
for f in (instance.source_path, instance.thumbnail_path):
|
||||
try:
|
||||
os.unlink(f)
|
||||
except FileNotFoundError:
|
||||
pass # The file's already gone, so we're cool with it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue