Skip to content

Commit

Permalink
records: fix issue with system user notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
lnielsen committed Feb 22, 2024
1 parent f189c6d commit 5779b58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion invenio_users_resources/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,12 @@ def deactivate(self):
def get_record(cls, id_):
"""Get the user via the specified ID."""
with db.session.no_autoflush:
user = current_datastore.get_user_by_id(id_)
# TODO: replace this by get_user_by_id()
# Notifications builders right now manage to pass "system" as an
# id when they try use the ServiceResultResolvers on
# {'user': 'system'} which results in a database transaction being
# rolled back when quering on an integer id column with a string.
user = current_datastore.get_user(id_)
if user is None:
return None

Expand Down

0 comments on commit 5779b58

Please sign in to comment.