Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Election status part 2 - cancelled elections #426

Merged
merged 2 commits into from
Oct 19, 2018

Conversation

chris48s
Copy link
Member

First bash at allowing us to deal with cancelled elections:

  • Data model changes to allow us to store that an election is cancelled, attach a document or notice and link 2 election records when one replaces another
  • Basic front-end work to allow an admin to set the 'cancelled' flag and 'replaces' field in /admin (front-end for notice document is TODO)
  • API changes so that client apps can pick up cancelled elections (this can be safely deployed without making changes to API consumers)
  • Front-end changes for showing cancelled elections on the EE website:

screenshot at 2018-10-19 11-35-18

Next steps:

  • Changes to consume this data in YNR, WCIVF, WDIV
  • Front-end changes to enable a wider group of authenticated users to use some of the features added here and in the last few PRs

if not self.cancelled and self.cancellation_notice:
raise ValidationError(
"Only a cancelled election can have a cancellation notice"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having added a couple of checks in here, it occurs to me that we've probably got various bits of validation in the wizard form class, ElectionBuilder class and /admin. When we add more front-end for authenticated users that problem will probably get even worse. I reckon it probably makes sense to try and collate more of that validation logic here in the model class, but I think I'll leave that to another PR to try and keep the scope of this one sensible.

Copy link
Member

@symroe symroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this looks great! One small comment, but otherwise good 👍

every_election/apps/elections/models.py Show resolved Hide resolved
@chris48s chris48s force-pushed the cancelled_elections branch from 3215522 to 78df738 Compare October 19, 2018 13:10
there's additional optimisation we can do here
but this is the easiest first step
@chris48s chris48s force-pushed the cancelled_elections branch from 78df738 to 60bd28d Compare October 19, 2018 13:48
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 71.293% when pulling 60bd28d on chris48s:cancelled_elections into d12f455 on DemocracyClub:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 71.293% when pulling 60bd28d on chris48s:cancelled_elections into d12f455 on DemocracyClub:master.

@chris48s chris48s merged commit fa8bfd6 into DemocracyClub:master Oct 19, 2018
@symroe symroe mentioned this pull request Dec 7, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants