Fix another issue with environments list
Change-Id: Ia55e7cafc79dde3a8d802acb29679315596cfd11
This commit is contained in:
parent
767710e852
commit
53befea3b1
@ -24,10 +24,16 @@ def save_draft(session_id, draft):
|
||||
def get_env_status(environment_id, session_id):
|
||||
status = 'draft'
|
||||
|
||||
unit = get_session()
|
||||
|
||||
if not session_id:
|
||||
session = unit.query(Session).filter(
|
||||
Session.environment_id == environment_id and Session.state.in_(['open', 'deploying'])).first()
|
||||
if session:
|
||||
session_id = session.id
|
||||
else:
|
||||
return status
|
||||
|
||||
unit = get_session()
|
||||
session_state = unit.query(Session).get(session_id).state
|
||||
reports_count = unit.query(Status).filter_by(environment_id=environment_id, session_id=session_id).count()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user