Fix the user view in the prototype.
This commit is contained in:
parent
7ceb249858
commit
15dfd887d0
1 changed files with 9 additions and 6 deletions
|
@ -542,13 +542,16 @@ def change_organization_details(orgname):
|
|||
abort(403)
|
||||
|
||||
def prototype_view(proto, org_members):
|
||||
if proto.delegate_user:
|
||||
delegate_view = {
|
||||
'name': proto.delegate_user.username,
|
||||
'is_robot': proto.delegate_user.robot,
|
||||
def prototype_user_view(user):
|
||||
return {
|
||||
'name': user.username,
|
||||
'is_robot': user.robot,
|
||||
'kind': 'user',
|
||||
'is_org_member': proto.delegate_user.username in org_members,
|
||||
'is_org_member': user.username in org_members,
|
||||
}
|
||||
|
||||
if proto.delegate_user:
|
||||
delegate_view = prototype_user_view(proto.delegate_user)
|
||||
else:
|
||||
delegate_view = {
|
||||
'name': proto.delegate_team.name,
|
||||
|
@ -556,7 +559,7 @@ def prototype_view(proto, org_members):
|
|||
}
|
||||
|
||||
return {
|
||||
'activating_user': user_view(proto.activating_user),
|
||||
'activating_user': prototype_user_view(proto.activating_user),
|
||||
'delegate': delegate_view,
|
||||
'role': proto.role.name,
|
||||
'id': proto.uuid,
|
||||
|
|
Reference in a new issue