fixing get epc data

This commit is contained in:
Khalim Conn-Kowlessar 2023-12-28 12:20:53 +00:00
parent 65b39750a3
commit 776bca7c24
2 changed files with 3 additions and 4 deletions

View file

@ -143,7 +143,6 @@ class SearchEpc:
if len(uprns) == 1:
return rows
logger.error("Multiple UPRNS found - we should use an alternate method of searching - TODO")
if property_type is not None:
# We can do a filter on the property type
rows_filtered = [r for r in rows if r["property-type"] == property_type]

View file

@ -292,7 +292,7 @@ def get_epc_data(data, cleaned, cleaning_data, created_at):
nodata.append(property_meta)
continue
newest_epc, older_epcs, full_sap_epc = searcher.retrieve(address=property_meta["Address"])
newest_epc, older_epcs, full_sap_epc = searcher.retrieve(address=property_meta["T1_Address"])
# We also want to get the penultimate epc
penultimate_epc, _ = searcher.filter_newest_epc(older_epcs)
if not penultimate_epc:
@ -336,8 +336,8 @@ def get_epc_data(data, cleaned, cleaning_data, created_at):
{
"row_id": property_meta["row_id"],
"uprn": eligibility.epc["uprn"],
"Address": property_meta["Address"],
"Postcode": property_meta["Postcode"],
"Address": property_meta["T1_Address"],
"Postcode": property_meta["postcode"],
"property_type": eligibility.epc["property-type"],
"gbis_eligible": eligibility.gbis_warmfront,
"eco4_eligible": eligibility.eco4_warmfront["eligible"],