Skip to content
Merged
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
6 changes: 6 additions & 0 deletions src/spaceone/identity/error/error_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ class ERROR_LAST_WORKSPACE_OWNER_CANNOT_DELETE(ERROR_INVALID_ARGUMENT):

class ERROR_LAST_DOMAIN_ADMIN_CANNOT_DELETE(ERROR_INVALID_ARGUMENT):
_message = "Last domain admin cannot be deleted."


class ERROR_NOT_ALLOWED_TO_UPDATE_ROLE_ASSIGNED_BY_WORKSPACE_GROUP(
ERROR_INVALID_ARGUMENT
):
_message = "Roles assigned by a Workspace Group cannot be updated from the User menu. (role_binding_id = {role_binding_id})"
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message contains a placeholder {role_binding_id} but the parameter being passed in the service is role_binding_id. The message should use {value} to match the parameter name being passed, or the service should pass role_binding_id=params.role_binding_id instead of value=params.role_binding_id.

Suggested change
_message = "Roles assigned by a Workspace Group cannot be updated from the User menu. (role_binding_id = {role_binding_id})"
_message = "Roles assigned by a Workspace Group cannot be updated from the User menu. (role_binding_id = {value})"

Copilot uses AI. Check for mistakes.
2 changes: 1 addition & 1 deletion src/spaceone/identity/model/user/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class UserUpdateRequest(BaseModel):
language: Union[str, None] = None
timezone: Union[str, None] = None
tags: Union[dict, None] = None
reset_password: Union[bool, None] = None
reset_password: Union[bool, None] = False
domain_id: str
enforce_mfa_state: Union[MFAEnforceState, None] = None
enforce_mfa_type: Union[MFAType, None] = None
Expand Down
2 changes: 1 addition & 1 deletion src/spaceone/identity/service/role_binding_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def update_role(
self.check_self_update_and_delete(request_user_id, rb_vo.user_id)

if rb_vo.workspace_group_id:
raise ERROR_PERMISSION_DENIED(
raise ERROR_NOT_ALLOWED_TO_UPDATE_ROLE_ASSIGNED_BY_WORKSPACE_GROUP(
key="role_binding_id", value=params.role_binding_id
)

Expand Down
Loading