add change and put it to production

This commit is contained in:
Jun-te Kim 2026-04-02 13:05:16 +00:00
parent 8d5115b6e8
commit 53ef72faab

View file

@ -462,6 +462,15 @@ def handler(event, context, local=False):
# Validate postcode before processing
if not AddressMatch.is_valid_postcode(postcode):
logger.warning(f"Postcode {postcode} is invalid, skipping")
for row in postcode_rows:
results_data.append(
{
**row,
"address2uprn_uprn": "invalid postcode",
"address2uprn_address": "invalid postcode",
"address2uprn_lexiscore": "invalid postcode",
}
)
continue
# Fetch EPC data once per postcode