diff --git a/wcivf/apps/elections/import_helpers.py b/wcivf/apps/elections/import_helpers.py index f0454a6b8..241702ccc 100644 --- a/wcivf/apps/elections/import_helpers.py +++ b/wcivf/apps/elections/import_helpers.py @@ -103,6 +103,24 @@ def update_or_create_from_ballot_dict(self, ballot_dict): }, ) + if ballot_dict["results"]: + election, created = Election.objects.update_or_create( + slug=slug, + election_type=election_type, + defaults={ + "ballot_papers_issued": ballot_dict["results"][ + "num_turnout_reported" + ], + "electorate": ballot_dict["results"][ + "total_electorate" + ], + "turnout": ballot_dict["results"]["turnout_percentage"], + "spoilt_ballots": ballot_dict["results"][ + "num_spoilt_ballots" + ], + }, + ) + self.import_metadata_from_ee(election) self.election_cache[election.slug] = election return self.election_cache[slug]