def unindex_model_on_delete(sender, document, **kwargs):
    '''Unindex Mongo document on post_delete'''
    if current_app.config.get('AUTO_INDEX'):
        unindex.delay(document)
def unindex_model_on_delete ( sender , document , ** kwargs ) : if current_app . config . get ( 'AUTO_INDEX' ) : unindex . delay ( document )
Unindex Mongo document on post_delete