Skip to content

Commit

Permalink
moderation: refactor 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 7694e84 commit dd9e5d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions invenio_requests/services/user_moderation/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def request_moderation(self, identity, user_id, data=None, uow=None, **kwargs):
topic = {"user": str(user_id)}

# Receiver can be configured, by default send the request to users with moderation role
receiver = {"group": role.name} # TODO to be changed to role id
creator = {"group": role.name} # TODO to be changed to role id
receiver = {"group": role.id}
creator = {"group": role.id}

request_item = self.requests_service.create(
identity,
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def superuser_role(database):
def moderator_role(app, database):
"""Moderator role."""
REQUESTS_MODERATION_ROLE = app.config["REQUESTS_MODERATION_ROLE"]
mod_role = Role(name=REQUESTS_MODERATION_ROLE)
mod_role = Role(id=REQUESTS_MODERATION_ROLE, name=REQUESTS_MODERATION_ROLE)
database.session.add(mod_role)

action_role = ActionRoles.create(action=user_management_action, role=mod_role)
Expand Down

0 comments on commit dd9e5d3

Please sign in to comment.