-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
if not self.cancelled and self.cancellation_notice: | ||
raise ValidationError( | ||
"Only a cancelled election can have a cancellation notice" | ||
) |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 👍
3215522
to
78df738
Compare
there's additional optimisation we can do here but this is the easiest first step
78df738
to
60bd28d
Compare
First bash at allowing us to deal with cancelled elections:
/admin
(front-end for notice document is TODO)Next steps: