def unindex_model_on_delete(sender, document, **kwargs): '''Unindex Mongo document on post_delete''' if current_app.config.get('AUTO_INDEX'): unindex.delay(*as_task_param(document))
def reindex_model_on_save(sender, document, **kwargs): '''(Re/Un)Index Mongo document on post_save''' if current_app.config.get('AUTO_INDEX'): reindex.delay(*as_task_param(document))