add Proxy Vote Application Deadline and Replacement Pack Start Date to calendar - #2624
Draft
chris48s wants to merge 10 commits into
Draft
add Proxy Vote Application Deadline and Replacement Pack Start Date to calendar#2624chris48s wants to merge 10 commits into
chris48s wants to merge 10 commits into
Conversation
also add a few missing test cases
chris48s
commented
Aug 13, 2026
Member
Author
There was a problem hiding this comment.
One of the consequences of storing these dates in the DB is: Every time we add a new date or fix a bug, we have to write one of these backfill migrations.
Member
Author
|
While I was working on the tests for this PR, I really felt like a lot of them are quite repetitive. I think we could refactor a lot of this to use |
Member
Author
|
Interestingly, I seem to have a test failing in CI that does not fail locally. |
chris48s
marked this pull request as draft
August 13, 2026 14:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs https://app.asana.com/1/1204880536137786/project/1204880927741389/task/1216553673590691?focus=true
The core point of this PR is to add 2 new dates to the election timetable:
proxy_vote_application_deadlinereplacement_pack_start_dateTODO: Before this is merge-able, there is also some downstream work to do on the response builder and API consumers. I've not had time to look at that yet.
As such, lets leave this as draft for the moment, but what is here is worth reviewing.
Proxy Vote Application Deadline
Using our handy matrix, I think the correct values for this are:
For most election types (all the ones where the unit test says "reference election: blabla.date"), I've validated this against a real election using the Electoral Commission's timetables from past elections.
So for example:
parl.2024-07-04: https://www.electoralcommission.org.uk/media/11454gla.2024-05-02: https://www.electoralcommission.org.uk/media/10649There are some election types where I haven't been able to check this. For example, the EC don't publish this for City of London or there isn't an example of the relevant election type in the last few years.
One of the issues here is that the EC issue basically issue no guidance for Northern Ireland, and there is nothing on
https://www.eoni.org.uk/voting/voting-by-post-or-proxy/
https://www.eoni.org.uk/faqs/absent-voting-faqs/
I was able to verify NI for local elections using
https://www.eoni.org.uk/media/r2miujg4/final-eoni-digital-registration-number-review-january-2024-paper.pdf#page=10
but I don't have anything I can check against for NIA or Parl.
For Westminster elections, my assumption is that NI has its own date rather than aligning with GB. I think https://www.electoralcommission.org.uk/media/11454 is implicitly GB only based on some of the other dates.
We could double-check this with a contact at EONI if we want.
Replacement Pack Start Date
Replacement packs are a bit messy. I think the correct values for this are:
Basically:
I've explained both of these points more in an inline comment here:
EveryElection/every_election/apps/elections/models.py
Lines 755 to 783 in cec9fab
So we essentially have two different flavours of "not applicable" (in the case of Scotland, that is to be more permissive, and in the case of NI it is loosely related to being less permissive).
My sources for what I am saying about NI are:
For Scottish Parliament, it is:
Again, I've checked everything off against guidance and historic timetables where those are published.
The main issue with this one is: I could see at least 3 different ways to possibly implement this in the code:
return Noneraise NotImplementedI don't think any of these options are obviously correct. I ended up implementing option 3 just because picking something meant I could keep moving. That said, you can also make a decent argument that I am wrong.
My current thinking on this is:
Currently there are no methods that return
Noneat the library layer. Everything either returns adt.date()or raisesNotImplemented. I think if we are going to also introduce a sentinel, we need a decent reason for that.However, we're going to represent it as
nullin the API anyway, so maybe just cut out the middleman?There are two situations where we raise
NotImplementedError, and that is the 2 SOPN dates (close of nominations and SOPN deadline) for referenda. I think in that case, its pretty clear to say "this conceptually does not make sense in this situation". I feel like these two flavours of "not applicable" aren't really quite the same. There's no set date, but the concept of a replacement pack does make sense in this context on some level. So I am reluctant to say they're the same.What I've done is consistent with what we do for the VAC deadline, but is what we're doing with that VAC deadline actually good?
Also, it feels like encoding the rules around this is more explicitly in the remit of the TTs library.
Anyway, I've done option 3:
.replacement_pack_start_datealways returns a date. I've only written tests for the cases where it makes sense, and EE has the logic to know when to use/not use that value. Its a starting point, and I can change it if we want.