Skip to content
Snippets Groups Projects
Commit 0301bfc4 authored by Samuel GAIST's avatar Samuel GAIST Committed by Samuel GAIST
Browse files

[team][api] Make serializer raise exception on validation

parent 56e8d9d3
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !327. Comments created here will be created in the context of that merge request.
......@@ -42,7 +42,6 @@ from .serializers import TeamUpdateSerializer
from .models import Team
from .permissions import IsOwner, HasPrivacyLevel
from ..common.responses import BadRequestResponse
from ..common.mixins import CommonContextMixin
......@@ -137,8 +136,7 @@ class TeamDetailView(CommonContextMixin, generics.RetrieveUpdateDestroyAPIView):
serializer = self.writing_serializer_class(
team, data=request.data, partial=True
)
if not (serializer.is_valid()):
return BadRequestResponse(serializer.errors)
serializer.is_valid(raise_exception=True)
db_object = serializer.save()
......
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