fix logic for roles
This commit is contained in:
parent
732555ac6a
commit
19802f56eb
2 changed files with 5 additions and 8 deletions
|
|
@ -262,9 +262,11 @@ def consent():
|
|||
.filter(AppRole.user_id == user.uuid)
|
||||
)
|
||||
for role_obj in role_objects:
|
||||
role_name = RoleService.get_role_by_id(role_obj.role_id).name
|
||||
if (role_name is not None):
|
||||
roles.append(role_name)
|
||||
app_role = RoleService.get_role_by_id(role_obj.role_id)
|
||||
if (app_role is None):
|
||||
roles.append('user')
|
||||
continue
|
||||
roles.append(app_role.name)
|
||||
|
||||
current_app.logger.info(f"Using '{roles}' when applying consent for {kratos_id}")
|
||||
|
||||
|
|
|
|||
Reference in a new issue