cvat-opencv icon indicating copy to clipboard operation
cvat-opencv copied to clipboard

After set use_zip_chunks to true, it appears as false in the response.

Open k1won opened this issue 2 years ago • 1 comments

My actions before raising this issue

  • [x] Read/searched the docs
  • [x] Searched past issues

Expected Behaviour

  • When POST /tasks/{id}/data is executed, the value set in the request body and the value appears in the response should be the same.

Current Behaviour

  • Use_zip_chunks, use_cache, and copy_data are all set to true, but it is appears as false in the response.

image

Possible Solution

  • Modify the return code of upload_finished() method of TaskViewSet class
diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py
index cca75503..29d58a1a 100644
--- a/cvat/apps/engine/views.py
+++ b/cvat/apps/engine/views.py
@@ -699,7 +699,7 @@ class TaskViewSet(UploadMixin, viewsets.ModelViewSet):
             if 'stop_frame' not in serializer.validated_data:
                 data['stop_frame'] = None
             task.create(self._object.id, data)
-            return Response(serializer.data, status=status.HTTP_202_ACCEPTED)
+            return Response(data, status=status.HTTP_202_ACCEPTED)
         return Response(data='Unknown upload was finished',
                         status=status.HTTP_400_BAD_REQUEST)

Steps to Reproduce (for bugs)

  1. create a task with this api endpoint : POST /api/tasks
  2. upload image data with this api endpoint : POST /api/tasks/{id}/data Set the following items to true in the request body.
  • use_zip_chunks
  • use_cache
  • copy_data

Context

Your Environment

  • Git hash commit (git log -1): dd60b2d8
  • Docker version docker version (e.g. Docker 17.0.05):
  • Are you using Docker Swarm or Kubernetes?
  • Operating System and version (e.g. Linux, Windows, MacOS): ubuntu 18.04
  • Code example or link to GitHub repo or gist to reproduce problem:
  • Other diagnostic information / logs:
    Logs from `cvat` container

Next steps

You may join our Gitter channel for community support.

k1won avatar Mar 21 '22 18:03 k1won

@Marishka17

Can you look into this issue?

bsekachev avatar Sep 06 '22 20:09 bsekachev