Skip to content

Commit

Permalink
fix(api): erroneous upload chunk request data consumption (#23)
Browse files Browse the repository at this point in the history
Fix issue resulting on error 400 when submitting upload chunks due to erroneous request data consumption.
  • Loading branch information
kennedykori committed Sep 11, 2022
1 parent ade99da commit 759f3a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/sql_data/apiviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ class SQLUploadMetadataViewSet(AuditBaseViewSet):
def start_chunk_upload(self, request: Request, pk) -> Response:
"""Start a new chunk upload."""
self.check_object_permissions(request, request.user)
request.data["upload_metadata"] = str(pk)
serializer: NewSQLUploadChunkSerializer = self.get_serializer(
data={**request.data, "upload_metadata": str(pk)}
data=request.data
)
if not serializer.is_valid():
return Response(
Expand Down

0 comments on commit 759f3a8

Please sign in to comment.