Skip to content

Commit

Permalink
Solution with fixed mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
obohatov committed Oct 19, 2023
1 parent e3653c4 commit d9d1c09
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cinema/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ def get(self, request):

def post(self, request):
serializer = GenreSerializer(data=request.data)

if serializer.is_valid():
serializer.save()
return Response(
serializer.data, status=status.HTTP_201_CREATED
)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)


class GenreDetail(APIView):
Expand Down

0 comments on commit d9d1c09

Please sign in to comment.