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 roleneed roleid #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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_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