diff --git a/backend/book_api/views/v1/book.py b/backend/book_api/views/v1/book.py index a69636f..fc6ffdc 100644 --- a/backend/book_api/views/v1/book.py +++ b/backend/book_api/views/v1/book.py @@ -51,11 +51,9 @@ def get(self, request, *args, **kwargs): def post(self, request, *args, **kwargs): self.permission_classes = [IsAdminOrModerator] self.check_permissions(request) - requested_data = request.data.copy() - requested_data['added_by'] = request.user.id - print(f"\nrequested_data: {requested_data}\n") + request.data['added_by'] = request.user.id serializer = BookSerializer( - data=requested_data, + data=request.data, ) serializer.is_valid(raise_exception=True) serializer.save()