Skip to content

Commit

Permalink
Merge pull request #47 from aanil/fix_portal_id
Browse files Browse the repository at this point in the history
Skip projects with no associated order portal ids
  • Loading branch information
aanil authored Nov 22, 2024
2 parents 460c1e1 + 9b4be39 commit 0298cf5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daily_read/ngi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ def get_data(self, project_id=None, close_date=None):
if close_date is None:
close_date = (datetime.datetime.now() - relativedelta(months=6)).strftime("%Y-%m-%d")
for row in self.statusdb_session.rows(close_date=close_date):
if "portal_id" not in row.value:
# Probably a project with no associated order(e.g legacy ESCG), log it and skip
log.error(f"No portal_id found in row {row.id}, skipping it!")
continue
portal_id = row.value["portal_id"]
order_year = row.value["order_year"]
# Should not happen, upstream manual entry error if it happens
Expand Down

0 comments on commit 0298cf5

Please sign in to comment.