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

add candidacy wizard: you can get a 500 error by selecting a post that's locked #970

Open
mhl opened this issue Dec 20, 2016 · 1 comment

Comments

@mhl
Copy link
Contributor

mhl commented Dec 20, 2016

If you're not in the "Trusted to Lock" group and use the add candidacy wizard to add a candidacy to a locked post, you can get through all the steps of the wizard before getting a 500 at the final submission. It'd be worth:

  • Adding validation to AddCandidacyPickPostForm to check that the post isn't locked (or that the user is in the "Trusted to Lock" group)
  • Perhaps only listing posts in the drop-down that are unlocked in the wizard (or marking them as locked)
@mhl
Copy link
Contributor Author

mhl commented Feb 4, 2017

Similarly, after the changes in #971 you would get a 403 error on trying to add someone in a locked constituency.

Thinking a bit more about this, my preference would be to create a custom widget for selecting posts in an election which ensures that:

  • Locked constituencies have " (locked)" appended to their name in the drop-down
  • If you're not in the "Trusted to Lock" group, the option elements for locked constituencies have the disabled="disabled" attribute set.

This could be used by both the wizard and SingleElectionFormView for the Javascript case.

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

No branches or pull requests

1 participant