Validation and correction for non-mapping form response #122
Labels
area: form submission
Code relating to the response submission to forms backend.
area: validation
Code relating to validation of user input and Pydantic models.
P3
Low priority tasks.
triage
Issues that require triage attention
type: bug
A bug that needs fixing!
Description
Submitting a non mapping response to a form, such as a list, returns a 500 error. It should return a 4xx error.
Reproduction Steps
/forms/submit/<form_name>
endpoint. See request body below.Request body:
{ "response": [] }
Traceback:
Files
No response
Technical Details
We are trying to access fields of the response, without checking if it is a mapping. When passing in a list, a
TypeError
is generated.Ideally, the fix will be a validator on the form_response model.
The text was updated successfully, but these errors were encountered: