diff --git a/sapl/materia/signals.py b/sapl/materia/signals.py index 9dd5e4fb9..e82f3b692 100644 --- a/sapl/materia/signals.py +++ b/sapl/materia/signals.py @@ -8,8 +8,3 @@ from .models import DocumentoAcessorio, MateriaLegislativa tramitacao_signal = django.dispatch.Signal(providing_args=['post', 'request']) - -# post_save.connect(save_texto, sender=MateriaLegislativa) -# post_save.connect(save_texto, sender=DocumentoAcessorio) -# post_delete.connect(delete_texto, sender=MateriaLegislativa) -# post_delete.connect(delete_texto, sender=DocumentoAcessorio) diff --git a/sapl/norma/signals.py b/sapl/norma/signals.py index 5743428e1..8f2e77c4b 100644 --- a/sapl/norma/signals.py +++ b/sapl/norma/signals.py @@ -3,6 +3,3 @@ from django.db.models.signals import post_delete, post_save from sapl.utils import delete_texto, save_texto from .models import NormaJuridica - -# post_save.connect(save_texto, sender=NormaJuridica) -# post_delete.connect(delete_texto, sender=NormaJuridica) diff --git a/sapl/settings.py b/sapl/settings.py index 8769115bc..7ca99b1bf 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -86,6 +86,7 @@ INSTALLED_APPS = ( ) + SAPL_APPS # FTS = Full Text Search +HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' SEARCH_BACKEND = 'haystack.backends.whoosh_backend.WhooshEngine' SEARCH_URL = ('PATH', PROJECT_DIR.child('whoosh')) diff --git a/sapl/utils.py b/sapl/utils.py index e4b3fc074..7a4146fc5 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -553,20 +553,3 @@ def texto_upload_path(instance, filename, subpath='', pk_first=False): } return path - - -class UpdateIndexCommand(Thread): - - def run(self): - call([PROJECT_DIR.child('manage.py'), 'update_index'], - stdout=PIPE) - - -def save_texto(sender, instance, **kwargs): - update_index = UpdateIndexCommand() - update_index.start() - - -def delete_texto(sender, instance, **kwargs): - update_index = UpdateIndexCommand() - update_index.start()