if null, remove from landlord remapping

This commit is contained in:
Khalim Conn-Kowlessar 2026-03-30 23:03:20 +01:00
parent f64344c3c3
commit f8ed406e89

View file

@ -566,6 +566,7 @@ class EPCRecord:
"multi_glaze_proportion": addr.landlord_multi_glaze_proportion,
"construction_age_band": addr.landlord_construction_age_band,
}
landlord_remapping = {k: v for k, v in landlord_remapping.items() if v is not None}
# Sanity check - ensure valid keys
if any(k not in self._prepared_epc for k in landlord_remapping):
@ -573,6 +574,7 @@ class EPCRecord:
self.landlord_differences = {} # Anything actaully changed
for k, v in landlord_remapping.items():
if k == "total_floor_area":
existing = self._prepared_epc.get(k)
if existing is not None and v is not None and abs(existing - v) > 1: # 1m tolerance