Add support for reindexing document on content parsing changes.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -4,11 +4,19 @@ import logging
|
||||
|
||||
from django.apps import apps
|
||||
|
||||
from document_indexing.tasks import task_index_document
|
||||
|
||||
from .settings import setting_auto_parsing
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def handler_index_document(sender, **kwargs):
|
||||
task_index_document.apply_async(
|
||||
kwargs=dict(document_id=kwargs['instance'].document.pk)
|
||||
)
|
||||
|
||||
|
||||
def handler_initialize_new_parsing_settings(sender, instance, **kwargs):
|
||||
DocumentTypeSettings = apps.get_model(
|
||||
app_label='document_parsing', model_name='DocumentTypeSettings'
|
||||
|
||||
Reference in New Issue
Block a user