Repository navigation
Conversation
JurorDAO.skip_voting() returned InvalidAction instead of raising it, so
POST /juror/round/<id>/tasks/skip answered {"success": true} for a vote id
of another juror, a vote id that doesn't exist, or a round the juror is not
in, and did nothing. Raise both errors so the endpoint answers 400.
Also refuse a vote id that belongs to a different round than the one in
the URL; before, that answered 200 and stored a stray id in the other
round's skipped list.
Adds a regression test (fails before the fix with status 'success').
Fixes #674.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #674.
JurorDAO.skip_voting()returnedInvalidActioninstead of raising it, so a skip of another juror's task, of a task that doesn't exist, or in a round the juror isn't in answered "success" and did nothing. Both errors are now raised, so the endpoint answers 400.It also refuses a task from a different round than the one in the URL. Before, that answered 200 and stored a stray id in the other round's list of skipped tasks.
Tests
test_skip_refuses_votes_of_other_users: skipping another juror's task, a task that doesn't exist, the juror's own task through another round's URL, and a task after the juror was removed from the round all give 400, and the juror's own first task is unchanged. It fails on master ('success' == 'failure'), and the wrong-round case fails if the new round check is taken out.Written by Claude (Claude Code) on behalf of @lgelauff.
🤖 Generated with Claude Code