mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
Fixed an ugly bug that broke all deletions
This commit is contained in:
parent
9e845ba813
commit
0a0ff8da90
1 changed files with 5 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ from subprocess import Popen
|
|||
|
||||
from django.conf import settings
|
||||
|
||||
from ..models import Correspondent, Tag
|
||||
from ..models import Correspondent, Document, Tag
|
||||
|
||||
|
||||
def logger(message, group):
|
||||
|
|
@ -85,6 +85,10 @@ def run_post_consume_script(sender, document, **kwargs):
|
|||
|
||||
|
||||
def cleanup_document_deletion(sender, instance, using, **kwargs):
|
||||
|
||||
if not isinstance(instance, Document):
|
||||
return
|
||||
|
||||
for f in (instance.source_path, instance.thumbnail_path):
|
||||
try:
|
||||
os.unlink(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue