An EPC without property_type falls back to its dwelling_type 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-07 11:39:32 +00:00
parent 9b146dfaf4
commit bf0e9343b2

View file

@ -107,8 +107,8 @@ def _resolved_property_types(
).all()
by_epc_source: dict[str, dict[int, str]] = {"lodged": {}, "predicted": {}}
for epc in epcs:
if epc.property_id is not None and epc.property_type is not None:
value = epc.property_type
value = epc.property_type or epc.dwelling_type
if epc.property_id is not None and value:
by_epc_source[epc.source][epc.property_id] = _PROPERTY_TYPE_CODES.get(
value, value
)