Skip to content

Commit

Permalink
resolvers: use the role ID rather than name to resolve the entity
Browse files Browse the repository at this point in the history
* the GroupResolver already uses the role ID rather than their name for
  creating reference dictionaries
  • Loading branch information
max-moser committed Aug 6, 2024
1 parent a096f9e commit 6614c37
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions invenio_users_resources/entity_resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def _resolve(self):
# Resolves to role name, not id
role_id = self._parse_ref_dict_id()
try:
return Role.query.filter(
Role.name == role_id # TODO to be changed to role id
).one()
return Role.query.filter(Role.id == role_id).one()
except NoResultFound:
return {}

Expand Down

0 comments on commit 6614c37

Please sign in to comment.