diff --git a/cinema/serializers.py b/cinema/serializers.py index 19231b84c..78ee14bcb 100644 --- a/cinema/serializers.py +++ b/cinema/serializers.py @@ -21,9 +21,15 @@ class Meta: class MovieSerializer(serializers.ModelSerializer): - actors = serializers.PrimaryKeyRelatedField(many=True, queryset=Actor.objects.all(), required=False) - genres = serializers.PrimaryKeyRelatedField(many=True, queryset=Genre.objects.all(), required=False) + actors = serializers.PrimaryKeyRelatedField( + many=True, + queryset=Actor.objects.all(), + required=False) + genres = serializers.PrimaryKeyRelatedField( + many=True, + queryset=Genre.objects.all(), + required=False) class Meta: model = Movie - fields = ["title", "description", "duration", "actors", "genres"] \ No newline at end of file + fields = ["title", "description", "duration", "actors", "genres"] diff --git a/cinema/views.py b/cinema/views.py index ce6ff35d9..3cd08b6d4 100644 --- a/cinema/views.py +++ b/cinema/views.py @@ -52,7 +52,10 @@ class MovieViewSet(viewsets.ModelViewSet): def update(self, request, *args, **kwargs): instance = self.get_object() - serializer = self.get_serializer(instance, data=request.data, partial=True) + serializer = self.get_serializer( + instance, + data=request.data, + partial=True) serializer.is_valid(raise_exception=True) self.perform_update(serializer) return Response(serializer.data)