Add pre and post signals to haystack's update index command
This commit is contained in:
14
apps/signaler/management/commands/update_index.py
Normal file
14
apps/signaler/management/commands/update_index.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from haystack.management.commands import update_index
|
||||
|
||||
from signaler.signals import post_update_index, pre_update_index
|
||||
|
||||
|
||||
class Command(update_index.Command):
|
||||
"""
|
||||
Wrapper for the haystack's update_index command
|
||||
"""
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
pre_update_index.send(sender=self)
|
||||
super(Command, self).handle(*args, **kwargs)
|
||||
post_update_index.send(sender=self)
|
||||
@@ -1,3 +1,5 @@
|
||||
from django.dispatch import Signal
|
||||
|
||||
pre_collectstatic = Signal()
|
||||
pre_update_index = Signal()
|
||||
post_update_index = Signal()
|
||||
|
||||
Reference in New Issue
Block a user