Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: changed method imput from element to list #1307

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions invenio_rdm_records/fixtures/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
4 changes: 2 additions & 2 deletions invenio_rdm_records/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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