Fix for #131: delete files on document.delete

This commit is contained in:
Daniel Quinn
2016-08-16 19:13:37 +01:00
parent 58a299b671
commit f5daded930
4 changed files with 39 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
from django.apps import AppConfig
from django.db.models.signals import post_delete
class DocumentsConfig(AppConfig):
@@ -10,8 +11,12 @@ class DocumentsConfig(AppConfig):
from .signals import document_consumption_started
from .signals import document_consumption_finished
from .signals.handlers import (
set_correspondent, set_tags, run_pre_consume_script,
run_post_consume_script)
set_correspondent,
set_tags,
run_pre_consume_script,
run_post_consume_script,
cleanup_document_deletion
)
document_consumption_started.connect(run_pre_consume_script)
@@ -19,4 +24,6 @@ class DocumentsConfig(AppConfig):
document_consumption_finished.connect(set_correspondent)
document_consumption_finished.connect(run_post_consume_script)
post_delete.connect(cleanup_document_deletion)
AppConfig.ready(self)