Merge pull request #1394 from dod-ccpo/fix-ghost

Fix ghost
This commit is contained in:
leigh-mil 2020-02-06 12:58:52 -05:00 committed by GitHub
commit 4c3de07684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -61,6 +61,10 @@ class Environment(
def portfolio_id(self): def portfolio_id(self):
return self.application.portfolio_id return self.application.portfolio_id
@property
def is_pending(self):
return self.cloud_id is None
def __repr__(self): def __repr__(self):
return "<Environment(name='{}', num_users='{}', application='{}', portfolio='{}', id='{}')>".format( return "<Environment(name='{}', num_users='{}', application='{}', portfolio='{}', id='{}')>".format(
self.name, self.name,

View File

@ -39,6 +39,7 @@ def get_environments_obj_for_app(application):
{ {
"id": env.id, "id": env.id,
"name": env.name, "name": env.name,
"pending": env.is_pending,
"edit_form": EditEnvironmentForm(obj=env), "edit_form": EditEnvironmentForm(obj=env),
"member_count": len(env.roles), "member_count": len(env.roles),
"members": sorted( "members": sorted(

View File

@ -47,7 +47,7 @@
<span> <span>
{{ env['name'] }} {{ env['name'] }}
</span> </span>
{{ Label(type="pending_creation", classes='label--below')}} {{ Label(type="pending_creation")}}
{%- endif %} {%- endif %}
{% if user_can(permissions.EDIT_ENVIRONMENT) -%} {% if user_can(permissions.EDIT_ENVIRONMENT) -%}
{{ {{