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)
|
abort(403)
|
||||||
|
|
||||||
def prototype_view(proto, org_members):
|
def prototype_view(proto, org_members):
|
||||||
if proto.delegate_user:
|
def prototype_user_view(user):
|
||||||
delegate_view = {
|
return {
|
||||||
'name': proto.delegate_user.username,
|
'name': user.username,
|
||||||
'is_robot': proto.delegate_user.robot,
|
'is_robot': user.robot,
|
||||||
'kind': 'user',
|
'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:
|
else:
|
||||||
delegate_view = {
|
delegate_view = {
|
||||||
'name': proto.delegate_team.name,
|
'name': proto.delegate_team.name,
|
||||||
|
@ -556,7 +559,7 @@ def prototype_view(proto, org_members):
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'activating_user': user_view(proto.activating_user),
|
'activating_user': prototype_user_view(proto.activating_user),
|
||||||
'delegate': delegate_view,
|
'delegate': delegate_view,
|
||||||
'role': proto.role.name,
|
'role': proto.role.name,
|
||||||
'id': proto.uuid,
|
'id': proto.uuid,
|
||||||
|
|
Reference in a new issue