diff --git a/greg/api/views/person.py b/greg/api/views/person.py index c856392bf83084053a417f424c61f4bacb5d8dfa..c096844d28282fbc405e866e2074a8b5427892d4 100644 --- a/greg/api/views/person.py +++ b/greg/api/views/person.py @@ -1,4 +1,4 @@ -from django.core.exceptions import BadRequest +from django.core.exceptions import ValidationError from django_filters import rest_framework as filters from rest_framework import viewsets @@ -45,6 +45,6 @@ class PersonRoleViewSet(viewsets.ModelViewSet): if person_id is None: # Should not happen, the person ID is part of the API path - raise BadRequest("No person id") + raise ValidationError("No person id") serializer.save(person_id=person_id)