diff --git a/django_pydantic_field/v1/fields.py b/django_pydantic_field/v1/fields.py index 22a7850..7409604 100644 --- a/django_pydantic_field/v1/fields.py +++ b/django_pydantic_field/v1/fields.py @@ -81,7 +81,7 @@ def to_python(self, value) -> "base.SchemaT": assert self.decoder is not None return self.decoder().decode(value) except pydantic.ValidationError as e: - raise django_exceptions.ValidationError(e.errors()) + raise django_exceptions.ValidationError(str(e)) from e def get_prep_value(self, value): if not self._is_prepared_schema: diff --git a/django_pydantic_field/v2/fields.py b/django_pydantic_field/v2/fields.py index a9d7cfe..5218452 100644 --- a/django_pydantic_field/v2/fields.py +++ b/django_pydantic_field/v2/fields.py @@ -170,8 +170,7 @@ def to_python(self, value: ty.Any): try: return self.adapter.validate_python(value) except pydantic.ValidationError as exc: - error_params = {"errors": exc.errors(), "field": self} - raise exceptions.ValidationError(exc.json(), code="invalid", params=error_params) from exc + raise exceptions.ValidationError(str(exc), code="invalid") from exc def get_prep_value(self, value: ty.Any): value = self._prepare_raw_value(value)