Ensure environment names are sorted when rendered
This commit is contained in:
@@ -22,19 +22,22 @@ from atst.jobs import send_mail
|
||||
|
||||
|
||||
def get_environments_obj_for_app(application):
|
||||
environments_obj = []
|
||||
for env in application.environments:
|
||||
env_data = {
|
||||
"id": env.id,
|
||||
"name": env.name,
|
||||
"pending": env.is_pending,
|
||||
"edit_form": EditEnvironmentForm(obj=env),
|
||||
"member_count": len(env.roles),
|
||||
"members": [env_role.application_role.user_name for env_role in env.roles],
|
||||
}
|
||||
environments_obj.append(env_data)
|
||||
|
||||
return environments_obj
|
||||
return sorted(
|
||||
[
|
||||
{
|
||||
"id": env.id,
|
||||
"name": env.name,
|
||||
"pending": env.is_pending,
|
||||
"edit_form": EditEnvironmentForm(obj=env),
|
||||
"member_count": len(env.roles),
|
||||
"members": [
|
||||
env_role.application_role.user_name for env_role in env.roles
|
||||
],
|
||||
}
|
||||
for env in application.environments
|
||||
],
|
||||
key=lambda env: env["name"],
|
||||
)
|
||||
|
||||
|
||||
def filter_perm_sets_data(member):
|
||||
|
Reference in New Issue
Block a user