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"] )