From 6e654b29a6baec87eb72c1c34e8dc4211f29eb41 Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Thu, 20 Jun 2024 16:06:54 +0200 Subject: [PATCH] Status fix for projects with dates that could have been closed or aborted --- daily_read/ngi_data.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daily_read/ngi_data.py b/daily_read/ngi_data.py index a2ddf75..1a78feb 100644 --- a/daily_read/ngi_data.py +++ b/daily_read/ngi_data.py @@ -278,8 +278,13 @@ def __init__( else: self.status = latest_statuses[0] else: - log.info(f"No project dates found for {project_id}, so setting its status to Pending") - self.status = "Pending" + log.info(f"No project dates found for {project_id}, trying to find status from internal_proj_status") + if internal_proj_status in ["Pending", "Aborted", "Closed"]: + self.status = internal_proj_status + else: + log.error( + f"ERROR! No project dates or incorrect internal_proj_status found for {project_id}, no status set!" + ) @property def internal_id_or_portal_id(self):