Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a constraint in the DB model as well.
This really should've been handled automatically by DRF, and in the future, it will be. But for now, we need to have constraints both on the serializer (to get status code 400), and on the model (to prevent direct database constraint violations). See encode/django-rest-framework#7173
- Loading branch information