From 5d800e4429fe55e14eff0d915db4a9227967a78f Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Mon, 20 Nov 2023 13:33:45 +0000 Subject: [PATCH] Assume candidates aren't verified if key not found --- api_endpoints/v1_postcode_lookup/upstream_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_endpoints/v1_postcode_lookup/upstream_api_client.py b/api_endpoints/v1_postcode_lookup/upstream_api_client.py index 3db4b28..97335fc 100644 --- a/api_endpoints/v1_postcode_lookup/upstream_api_client.py +++ b/api_endpoints/v1_postcode_lookup/upstream_api_client.py @@ -59,7 +59,7 @@ def clean_ballots(self, ballots): ballot.pop("wcivf_url", None) ballot.pop("hustings", None) ballot.pop("ballot_url", None) - if ballot["candidates_verified"]: + if ballot.get("candidates_verified", False): ballot["candidates"] = self.clean_candidates( ballot["candidates"] )