You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The refactoring is needed to filter issues like Sentry Issue: BACKEND-G caused by an invalid request body. (the problem is what frontend sent us SetOne object with questionId > 10)
Details:
ValueError: 15 is not a valid PersonalValue
(10 additional frame(s) were not displayed)
...
File "app/scoring/process_scores.py", line 43, in calculate_scores
value_type = PersonalValue(question_id)
File "enum.py", line 309, in __call__
return cls.__new__(cls, value)
File "enum.py", line 600, in __new__
raise exc
File "enum.py", line 584, in __new__
result = cls._missing_(value)
File "enum.py", line 613, in _missing_
raise ValueError("%r is not a valid %s" % (value, cls.__name__))
new marshmallow schema created to validate the request body
documentation (Climate-Mind_bundled.yml) updated to show 422 HTTP error
Tests
integration test for the endpoint OR/AND unit test for a schema
The text was updated successfully, but these errors were encountered:
danmash
changed the title
ValueError: 15 is not a valid PersonalValue
app/scoring/routes.py::user_scores refactoring (ValueError: 15 is not a valid PersonalValue)
Jul 20, 2022
danmash
changed the title
app/scoring/routes.py::user_scores refactoring (ValueError: 15 is not a valid PersonalValue)
app/scoring/routes.py user_scores refactoring (ValueError: 15 is not a valid PersonalValue)
Jul 20, 2022
danmash
changed the title
app/scoring/routes.py user_scores refactoring (ValueError: 15 is not a valid PersonalValue)
app/scoring/routes.py user_scores refactoring
Jul 20, 2022
danmash
changed the title
app/scoring/routes.py user_scores refactoring
Refactor user_scores endpoint to add marshmallow schema validation
Oct 12, 2022
Modules and functions to refactor
Refactor reason
The refactoring is needed to filter issues like Sentry Issue: BACKEND-G caused by an invalid request body. (the problem is what frontend sent us
SetOne
object withquestionId
> 10)Details:
request body
Suggested solution
Tests
The text was updated successfully, but these errors were encountered: