Skip to content

fix(ui): enforce threshold selection for ranking rounds to prevent 500 error (#383)#501

Open
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
ayushshukla1807:fix-ranking-round-threshold-validation-383
Open

fix(ui): enforce threshold selection for ranking rounds to prevent 500 error (#383)#501
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
ayushshukla1807:fix-ranking-round-threshold-validation-383

Conversation

@ayushshukla1807
Copy link
Copy Markdown

@ayushshukla1807 ayushshukla1807 commented Apr 15, 2026

Fixes #383.

If a ranking round was submitted without a threshold, threshold: null was being sent to the API. Since the backend expects an int/float, this silently crashed the request with a 500 error.

I added a quick check in RoundNew.vue to trap this locally and trigger the standard form validation alert (alertService.error) instead, avoiding the network crash entirely.

@ayushshukla1807
Copy link
Copy Markdown
Author

ayushshukla1807 commented Apr 15, 2026

Just simulated this exact bug locally (vote_method='ranking' with a missing threshold).

With this patch, submitRound() actually stops the request and throws the normal alertService.error missing field alert, so the silent API 500 is completely avoided. Zero network calls made.

Ran the frontend build and basic tests too:

montage/tests/test_web_basic.py::test_home_client            PASSED   [ 50%]
montage/tests/test_web_basic.py::test_multiple_jurors        PASSED   [100%]

View local dev screenshots

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

1 participant