From 93295624a5b36042aff1407c17cd137ecd0d7cf8 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Fri, 13 Jan 2023 09:08:43 +0100 Subject: [PATCH] fix Hackney links application_id source was changed and it broke this hidden internal use of it - here we need borough identifier fixes #1047 and repairs dffa4e244b69719c43400d2571c1242c8eb409b6 --- .../obtain_livestream_data_and_load_into_database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etl/planning_data/obtain_livestream_data_and_load_into_database.py b/etl/planning_data/obtain_livestream_data_and_load_into_database.py index 5031789e..92aa2e32 100644 --- a/etl/planning_data/obtain_livestream_data_and_load_into_database.py +++ b/etl/planning_data/obtain_livestream_data_and_load_into_database.py @@ -39,6 +39,7 @@ def load_data_into_database(cursor, data): if entry['_source']['description'] != None: description = entry['_source']['description'].strip() application_id = entry['_source']['lpa_app_no'] + application_id_with_borough_identifier = entry['_source']['id'] decision_date = parse_date_string_into_date_object(entry['_source']['decision_date']) last_synced_date = parse_date_string_into_date_object(entry['_source']['last_synced']) uprn = entry['_source']['uprn'] @@ -87,7 +88,7 @@ def load_data_into_database(cursor, data): print("last_synced_date is treated as invalid:", entry["last_synced_date"]) entry["last_synced_date"] = None - if "Hackney" in entry["application_id"]: + if "Hackney" in application_id_with_borough_identifier: if entry["application_url"] != None: if "https://" not in entry["application_url"]: entry["application_url"] = "https://developmentandhousing.hackney.gov.uk" + entry["application_url"]