From 2171426bb80f80c3e909e37404655c5cbe348537 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 20 Apr 2021 13:22:34 +0900 Subject: [PATCH] Enable to pass task id to download api --- app/api/urls.py | 4 ++-- app/api/views/export_dataset.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/urls.py b/app/api/urls.py index 0681bb16..2e491e97 100644 --- a/app/api/urls.py +++ b/app/api/urls.py @@ -19,9 +19,9 @@ urlpatterns_project = [ name='download-format' ), path( - route='export', + route='download', view=views.DownloadAPI.as_view(), - name='export-dataset' + name='download-dataset' ), path( route='statistics', diff --git a/app/api/views/export_dataset.py b/app/api/views/export_dataset.py index d87ed9d5..ef71f45a 100644 --- a/app/api/views/export_dataset.py +++ b/app/api/views/export_dataset.py @@ -26,7 +26,8 @@ class DownloadAPI(APIView): permission_classes = [IsAuthenticated & IsProjectAdmin] def get(self, request, *args, **kwargs): - task = AsyncResult(kwargs['task_id']) + task_id = request.GET['taskId'] + task = AsyncResult(task_id) ready = task.ready() if ready: filename = task.result