-
Notifications
You must be signed in to change notification settings - Fork 11
Description
@annavik discovered that the field validators for GET parameters and other user-passed values are returning 500 errors instead of 400's. Also the error message data does not specify which field has a validation issue. This is because we are using Django's form field validators instead of the Django Rest Framework validators (from its serializers). Two examples that fixe this issue were introduced in #643, and this pattern needs to be applied to other cases where we are importing from django.forms (IntegerField, DateField, etc.). In general, the solution is to always make a serializer, and then call is_valid() on the serializer, which will raise a 400 error with a detailed & structured message about each field.
Also in the case that a 500 is still returned from the backend, it is possible that the response has some error information. We frontend should be able to display that as well.