This PR adds a way to accumulate all validation errors in BcnSerializer and AnalysisSerializer before throwing NUM_ERRORS_LIMIT number of Exceptions after validation. Note: NUM_ERRORS_LIMIT is the maximum number of errors that are displayed to the user when an error occurs, and can be changed from
/e3_django/API/variables.
For example, NUM_ERRORS_LIMIT=5 will display up to 5 errors that occurred while creating the object, to the user.
Motivation and Context
Prior to this change, both BcnSerializer and AnalysisSerializer threw a ValidationError upon discovering a single error. This was inconvenient especially when user was providing a large number of inputs, because the user had to go back and fix one error, send a request, fix the next error, send another request, and so on, to fix all the issues in calculation (if more than one error occurred).
Description
This PR adds a way to accumulate all validation errors in
BcnSerializer
andAnalysisSerializer
before throwingNUM_ERRORS_LIMIT
number of Exceptions after validation. Note: NUM_ERRORS_LIMIT is the maximum number of errors that are displayed to the user when an error occurs, and can be changed from/e3_django/API/variables
.For example, NUM_ERRORS_LIMIT=5 will display up to 5 errors that occurred while creating the object, to the user.
Motivation and Context
Prior to this change, both
BcnSerializer
andAnalysisSerializer
threw a ValidationError upon discovering a single error. This was inconvenient especially when user was providing a large number of inputs, because the user had to go back and fix one error, send a request, fix the next error, send another request, and so on, to fix all the issues in calculation (if more than one error occurred).Closes #12