Skip to content
Snippets Groups Projects
Commit 2b0b5e83 authored by Tore.Brede's avatar Tore.Brede
Browse files

GREG-5: Switching exception type to avoid problem with mypy

parent c91d0f3d
No related branches found
No related tags found
1 merge request!10GREG-5: Add post role for person
Pipeline #88187 passed
from django.core.exceptions import BadRequest from django.core.exceptions import ValidationError
from django_filters import rest_framework as filters from django_filters import rest_framework as filters
from rest_framework import viewsets from rest_framework import viewsets
...@@ -45,6 +45,6 @@ class PersonRoleViewSet(viewsets.ModelViewSet): ...@@ -45,6 +45,6 @@ class PersonRoleViewSet(viewsets.ModelViewSet):
if person_id is None: if person_id is None:
# Should not happen, the person ID is part of the API path # 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) serializer.save(person_id=person_id)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment