Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Add candidacy wizard: make historic elections an option #969

Merged
merged 2 commits into from
Dec 20, 2016

Conversation

mhl
Copy link
Contributor

@mhl mhl commented Dec 20, 2016

Previously the default was to show all elections, whether they were
current or not, but @symroe pointed out that there might be thousands of
such elections, which in normal use would be irrelevant.

This commit makes the inclusion of non-current ('historic') elections in
the election picker stage an option - they're only shown if there's an
'historic=1' query parameter. There's also a link to that version of the
picker from the normal one.

Previously the default was to show all elections, whether they were
current or not, but @symroe pointed out that there might be thousands of
such elections, which in normal use would be irrelevant.

This commit makes the inclusion of non-current ('historic') elections in
the election picker stage an option - they're only shown if there's an
'historic=1' query parameter. There's also a link to that version of the
picker from the normal one.
@symroe
Copy link
Collaborator

symroe commented Dec 20, 2016

This is great! Thanks Mark.

In future we might want to disable adding candidates to non-current elections, for example, for May 2016 in the UK we know we had 100% of candidates, so adding a new one would always be wrong.

I think this would be easy to add as a setting like ALLOW_ADDING_HISTORIC_CANDIDACIES, and then looking for that in this form.

EDIT: once again I'm too slow in my review!

@mhl
Copy link
Contributor Author

mhl commented Dec 20, 2016

You're not too slow, it's still open and unmerged!

@symroe
Copy link
Collaborator

symroe commented Dec 20, 2016

Oh yes – I looked saw the merged tag on the link to the other PR and thought is was this one :)

@mhl
Copy link
Contributor Author

mhl commented Dec 20, 2016

In future we might want to disable adding candidates to non-current elections, for example, for May 2016 in the UK we know we had 100% of candidates, so adding a new one would always be wrong.

I think this would be easy to add as a setting like ALLOW_ADDING_HISTORIC_CANDIDACIES, and then looking for that in this form.

I'm not sure about this, but it feels to me that this is already covered by being able to lock posts, which already stops new candidacies being added (by unprivileged users). To take the May 2016 example, all the posts in those elections are locked now, I think, so only people in the "Trusted to Lock" group would be able to add candidacies via this means anyway. Do you think an ALLOW_ADDING_HISTORIC_CANDIDACIES setting would be useful in addition to the locking?

@symroe
Copy link
Collaborator

symroe commented Dec 20, 2016

Oh that makes sense. Maybe it's fine then, although it might result in an odd error if someone tries to add someone to an election with a locked post.

I expect it's such a rare case that it doesn't actually matter.

@mhl
Copy link
Contributor Author

mhl commented Dec 20, 2016

The error you get on selecting an election with only locked posts is OK (if a bit ugly):

trying-to-add-to-locked

... but yeah, if there are some unlocked posts in the election you just get a 500 at the final step of of the wizard. I think I'll create a new issue for that, though, since, as you say, it's a pretty rare case, and that was a bug already present before this PR.

@symroe
Copy link
Collaborator

symroe commented Dec 20, 2016

Excellent :) In that case, this PR looks good to me :)

@mhl mhl merged commit cd92da0 into master Dec 20, 2016
@mhl
Copy link
Contributor Author

mhl commented Dec 20, 2016

Thanks for the review, Sym - I've merged this and the new issue is #970

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants