(prefix: str, err: DjangoValidationError)
| 119 | |
| 120 | |
| 121 | def transform_validation_error(prefix: str, err: DjangoValidationError): |
| 122 | if hasattr(err, "error_dict"): |
| 123 | errors = flatten_errors(prefix, err.error_dict) |
| 124 | elif not hasattr(err, "message"): |
| 125 | errors = flatten_errors(prefix, err.error_list) |
| 126 | else: |
| 127 | raise HttpError(err.code or "validation_error", err.message) |
| 128 | raise HttpError(code="field_errors", detail="Field validations failed.", errors=errors) |
no test coverage detected