Update test_for_user to make variables clearer and add in a test case that should not be included in the list returned.
Use list comprehension in portfolio_applications route to get list of all environments for a user
This commit is contained in:
@@ -25,9 +25,9 @@ def has_portfolio_applications(_user, portfolio=None, **_kwargs):
|
||||
)
|
||||
def portfolio_applications(portfolio_id):
|
||||
user_env_roles = EnvironmentRoles.for_user(g.current_user.id, portfolio_id)
|
||||
environment_access = {}
|
||||
for env_role in user_env_roles:
|
||||
environment_access[env_role.environment_id] = env_role.role
|
||||
environment_access = {
|
||||
env_role.environment_id: env_role.role for env_role in user_env_roles
|
||||
}
|
||||
|
||||
return render_template(
|
||||
"applications/index.html", environment_access=environment_access
|
||||
|
Reference in New Issue
Block a user