From 2c8f4eeaa04bcbfb535153a7740499247786f618 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Thu, 6 Feb 2020 11:03:04 -0500 Subject: [PATCH] Add Environment property is_pending back because it is used in the UI to display the "Pending Creation" tag --- atst/models/environment.py | 4 ++++ atst/routes/applications/settings.py | 1 + templates/applications/fragments/environments.html | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/atst/models/environment.py b/atst/models/environment.py index cd202fd0..6eb0c02d 100644 --- a/atst/models/environment.py +++ b/atst/models/environment.py @@ -61,6 +61,10 @@ class Environment( def portfolio_id(self): return self.application.portfolio_id + @property + def is_pending(self): + return self.cloud_id is None + def __repr__(self): return "".format( self.name, diff --git a/atst/routes/applications/settings.py b/atst/routes/applications/settings.py index ad8a6540..8807c7f1 100644 --- a/atst/routes/applications/settings.py +++ b/atst/routes/applications/settings.py @@ -39,6 +39,7 @@ def get_environments_obj_for_app(application): { "id": env.id, "name": env.name, + "pending": env.is_pending, "edit_form": EditEnvironmentForm(obj=env), "member_count": len(env.roles), "members": sorted( diff --git a/templates/applications/fragments/environments.html b/templates/applications/fragments/environments.html index d0934268..5b4be1de 100644 --- a/templates/applications/fragments/environments.html +++ b/templates/applications/fragments/environments.html @@ -47,7 +47,7 @@ {{ env['name'] }} - {{ Label(type="pending_creation", classes='label--below')}} + {{ Label(type="pending_creation")}} {%- endif %} {% if user_can(permissions.EDIT_ENVIRONMENT) -%} {{