From ee3d4179fa7e2b8d3c68ec977574451bcd5f02b4 Mon Sep 17 00:00:00 2001 From: Martin Lettry Date: Fri, 12 May 2023 17:49:47 +0200 Subject: [PATCH] refactor: changed method imput from element to list * made compatible with changes from this PR * closes https://github.com/inveniosoftware/invenio-users-resources/issues/76 --- invenio_rdm_records/fixtures/users.py | 4 ++-- invenio_rdm_records/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/invenio_rdm_records/fixtures/users.py b/invenio_rdm_records/fixtures/users.py index e7ec0fadf..f18b43e55 100644 --- a/invenio_rdm_records/fixtures/users.py +++ b/invenio_rdm_records/fixtures/users.py @@ -18,7 +18,7 @@ from invenio_access.proxies import current_access from invenio_accounts.proxies import current_datastore from invenio_db import db -from invenio_users_resources.services.users.tasks import reindex_user +from invenio_users_resources.services.users.tasks import reindex_users from sqlalchemy.exc import IntegrityError from .fixture import FixtureMixin @@ -77,7 +77,7 @@ def create(self, entry): confirm_user(user) db.session.commit() - reindex_user(user.id) + reindex_users([user.id]) except IntegrityError: current_app.logger.info(f"skipping creation of {email}, already existing") db.session.rollback() diff --git a/invenio_rdm_records/utils.py b/invenio_rdm_records/utils.py index eb1746a77..b34e1d27b 100644 --- a/invenio_rdm_records/utils.py +++ b/invenio_rdm_records/utils.py @@ -12,7 +12,7 @@ from flask_security.utils import hash_password from invenio_accounts.proxies import current_datastore from invenio_db import db -from invenio_users_resources.services.users.tasks import reindex_user +from invenio_users_resources.services.users.tasks import reindex_users def get_or_create_user(email): @@ -35,5 +35,5 @@ def get_or_create_user(email): ) confirm_user(user) db.session.commit() - reindex_user(user.id) + reindex_users([user.id]) return user