Skip to content

Commit

Permalink
fixed: #181 - book upload error
Browse files Browse the repository at this point in the history
  • Loading branch information
rkshaon committed Nov 30, 2024
1 parent 5e0aa13 commit 28bf087
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/book_api/views/v1/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 28bf087

Please sign in to comment.