DemocracyClub/EveryElection

Move all cancellation logic to EE

symroe opened this issue · 1 comments

symroe commented

At the moment we can either cancel elections in EE or have YNR mark them as uncontested.

This gets complex quickly and means we have two sources of truth.

We also don't really present the reason for cancellation in EE, rather we have a boolean field and some other ways (metadata, seats contested) to work out what's going on.

The devs.DC API manages some of this logic for us:

https://github.com/DemocracyClub/aggregator-api/blob/master/api/endpoints/v1/voting_information/stitcher.py#L87-L105

We can move this 'up' into EE and simplify all downstream logic.

This looks like:

Tasks

  1. front end
  2. front end

We're going to need to think about this a little more, but that's the basic outline.

Ideally we'd find a way for YNR to push new information to EE when we lock an uncontested ballot, but this might be too complex for the initial version. Better to improve the admin interface to allow users to to this manually, as this needs to be done anyway.

Once this is done, we can clean up the logic from the widget, WDIV, WCIVF and the Devs.DC API.

Finished in #2004