You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a ballot-level election is deleted on EE, YNR's EE importer can't currently find out about it. This is causing the sites to be out of sync.
The issue is caused by the fact that the command that syncs YNR with EE (uk_create_elections_from_every_election) looks for top-level elections then looks for their children.
In the command:
delete_deleted_elections only syncs deleted top-level elections and then looks for their deleted child ballots:
No matter what other parameters are passed, build_election_tree always queries for top-level elections first, then queries for the ballots of those elections:
There are probably a couple ways to address this but the simplest might be changing delete_deleted_elections so that it also looks for deleted ballots.
If a ballot-level election is deleted on EE, YNR's EE importer can't currently find out about it. This is causing the sites to be out of sync.
The issue is caused by the fact that the command that syncs YNR with EE (
uk_create_elections_from_every_election
) looks for top-level elections then looks for their children.In the command:
delete_deleted_elections
only syncs deleted top-level elections and then looks for their deleted child ballots:yournextrepresentative/ynr/apps/elections/uk/management/commands/uk_create_elections_from_every_election.py
Lines 120 to 139 in 0096b0f
import_approved_elections
only syncs top-level elections and then looks for their non-deleted child ballots.yournextrepresentative/ynr/apps/elections/uk/management/commands/uk_create_elections_from_every_election.py
Lines 59 to 89 in 0096b0f
In the case of a top-level election with a deleted ballot:
delete_deleted_elections
won't find the deleted ballot because its parent is not deletedimport_approved_elections
won't find the deleted ballot, even if it finds the top level election, because it only looks for non-deleted ballotsThey both pass parameters to
EveryElectionWrapper
'sbuild_election_tree
to query the EE api:yournextrepresentative/ynr/apps/elections/uk/every_election.py
Line 369 in 0096b0f
No matter what other parameters are passed,
build_election_tree
always queries for top-level elections first, then queries for the ballots of those elections:yournextrepresentative/ynr/apps/elections/uk/every_election.py
Lines 383 to 385 in 0096b0f
There are probably a couple ways to address this but the simplest might be changing
delete_deleted_elections
so that it also looks for deleted ballots.Related issue on EE: DemocracyClub/EveryElection#2289
The text was updated successfully, but these errors were encountered: