diff --git a/invenio_records/receivers.py b/invenio_records/receivers.py index 4f2161ce..ade7dbf3 100644 --- a/invenio_records/receivers.py +++ b/invenio_records/receivers.py @@ -32,5 +32,6 @@ def record_modification(sender, changes): def new_collection(mapper, connection, target): + from .tasks.index import index_collection_percolator if target.dbquery is not None: index_collection_percolator.delay(target.name, target.dbquery) diff --git a/invenio_records/tasks/api.py b/invenio_records/tasks/api.py index e5fcd932..60ba36f6 100644 --- a/invenio_records/tasks/api.py +++ b/invenio_records/tasks/api.py @@ -21,6 +21,7 @@ from celery.utils.log import get_task_logger +from sqlalchemy import exc from invenio_celery import celery