From f768854c92b5f442baa3d9a79b3e898655c56c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Andr=C3=A9s=20Marino=20Rojas?= <47573394+Marinovsky@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:22:27 -0500 Subject: [PATCH] Fix bugs --- lean/components/util/live_utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lean/components/util/live_utils.py b/lean/components/util/live_utils.py index 5f79006b..7173301d 100644 --- a/lean/components/util/live_utils.py +++ b/lean/components/util/live_utils.py @@ -29,9 +29,8 @@ def _get_last_portfolio(api_client: APIClient, project_id: str, project_name: Pa cloud_last_time = utc.localize(datetime.min) if project_id: cloud_deployment = api_client.get("live/read", {"projectId": project_id}) - container.logger.info(f'----- After cloud_deployment_list: {cloud_deployment}') - if cloud_deployment["success"]: - cloud_last_time = datetime.strptime(cloud_deployment["launched"], "%Y-%m-%d %H:%M:%S").astimezone(UTC) + if cloud_deployment["success"] and cloud_deployment["status"] != "Undefined": + cloud_last_time = datetime.strptime(cloud_deployment["stopped"], "%Y-%m-%d %H:%M:%S").astimezone(UTC) local_last_time = utc.localize(datetime.min) live_deployment_path = f"{project_name}/live"