Skip to content

fix(backend): return 400 instead of 500 when threshold is null in advance_round#533

Open
lgelauff wants to merge 2 commits into
masterfrom
fix/advance-round-null-threshold-383
Open

fix(backend): return 400 instead of 500 when threshold is null in advance_round#533
lgelauff wants to merge 2 commits into
masterfrom
fix/advance-round-null-threshold-383

Conversation

@lgelauff

Copy link
Copy Markdown
Collaborator

Closes #383.

What changed

Frontend (cherry-picked from #384, authored by @Oyelakin-Mercy): validates that a threshold is selected before submitting the advance-round form, showing a specific error message (montage-required-threshold) rather than letting the request through.

Backend (admin_endpoints.py): the existing except KeyError did not catch the case where threshold is present in the request but set to nullfloat(None) raises TypeError, not KeyError, so the exception propagated as an unhandled 500. Fix catches TypeError and ValueError alongside KeyError.

i18n: adds the missing qqq.json documentation entry for montage-required-threshold.

Reproduction

python .claude/reproduce_383.py   # requires local instance with debug: true

Before: threshold: null → 500 Internal Server Error
After: threshold: null → 400 with "unset threshold. set the threshold and try again."

Oyelakin-Mercy and others added 2 commits April 27, 2026 17:40
…ance_round (#383)

float(None) raises TypeError which was not caught by the existing except KeyError,
causing an unhandled 500. Also adds missing qqq.json entry for the threshold
validation i18n key added in the frontend fix.

Fixes #383

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Network error shown when creating ranking round without threshold selection

2 participants