Skip to content

Raise correct exception type on model field validation

Pre-release
Pre-release

Choose a tag to compare

@surenkov surenkov released this 13 Sep 09:53
· 204 commits to master since this release

Django model fields are required to throw django.core.exceptions.ValidationError during .to_python(value) call.
Let's stick to that recommendation.

Convert the input value into the expected Python data type, raising
django.core.exceptions.ValidationError if the data can't be converted.