Skip to content

Commit

Permalink
roles: changed need creation by role name to id
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo committed Aug 9, 2023
1 parent ef490d8 commit c0ae04e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 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 @@ -113,9 +113,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
1 change: 0 additions & 1 deletion invenio_users_resources/services/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from functools import reduce
from itertools import chain

from flask_principal import RoleNeed
from invenio_records_permissions.generators import Generator, UserNeed
from invenio_search.engine import dsl

Expand Down

0 comments on commit c0ae04e

Please sign in to comment.