Add the mayan_runtime option to the intercepted update_index command
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
from optparse import make_option
|
||||||
|
|
||||||
from haystack.management.commands import update_index
|
from haystack.management.commands import update_index
|
||||||
|
|
||||||
from signaler.signals import post_update_index, pre_update_index
|
from signaler.signals import post_update_index, pre_update_index
|
||||||
@@ -7,8 +9,12 @@ class Command(update_index.Command):
|
|||||||
"""
|
"""
|
||||||
Wrapper for the haystack's update_index command
|
Wrapper for the haystack's update_index command
|
||||||
"""
|
"""
|
||||||
|
option_list = update_index.Command.option_list + (
|
||||||
|
make_option('--mayan_runtime', action='store_true', dest='mayan_runtime', default=False),
|
||||||
|
)
|
||||||
|
|
||||||
def handle(self, *args, **kwargs):
|
def handle(self, *args, **kwargs):
|
||||||
pre_update_index.send(sender=self)
|
mayan_runtime = kwargs.pop('mayan_runtime')
|
||||||
|
pre_update_index.send(sender=self, mayan_runtime=mayan_runtime)
|
||||||
super(Command, self).handle(*args, **kwargs)
|
super(Command, self).handle(*args, **kwargs)
|
||||||
post_update_index.send(sender=self)
|
post_update_index.send(sender=self, mayan_runtime=mayan_runtime)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from django.dispatch import Signal
|
from django.dispatch import Signal
|
||||||
|
|
||||||
pre_collectstatic = Signal()
|
pre_collectstatic = Signal()
|
||||||
pre_update_index = Signal()
|
pre_update_index = Signal(providing_args=['mayan_runtime'])
|
||||||
post_update_index = Signal()
|
post_update_index = Signal(providing_args=['mayan_runtime'])
|
||||||
|
|||||||
Reference in New Issue
Block a user