Skip to content

Commit 3b6464f

Browse files
committed
Ensure requested condorcet calculations are on vote components
1 parent b5bb7e0 commit 3b6464f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/routes/forms/condorcet.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ async def get(self, request: Request) -> JSONResponse:
7878
detail="Requested more winners than there are candidates", status_code=400
7979
)
8080

81+
if question.type != "vote":
82+
raise InvalidCondorcetRequest(
83+
detail="Requested question is not a condorcet vote component", status_code=400
84+
)
85+
8186
cursor = request.state.db.responses.find(
8287
{"form_id": form_id},
8388
)

0 commit comments

Comments
 (0)