Some environments might not have associated users.

There was a bug in the application settings route that threw an error if
an environment role and its associated application role did not have an
associated user. Updated to check for the user name on the application role.
This commit is contained in:
dandds
2019-06-19 10:12:01 -04:00
parent a91d438d1c
commit 3c5df7b1aa
2 changed files with 5 additions and 12 deletions

View File

@@ -21,8 +21,8 @@ def get_environments_obj_for_app(application):
"id": env.id,
"name": env.name,
"edit_form": EditEnvironmentForm(obj=env),
"member_count": len(env.users),
"members": [user.full_name for user in env.users],
"member_count": len(env.roles),
"members": [env_role.application_role.user_name for env_role in env.roles],
}
environments_obj.append(env_data)