Browse Source
Merge pull request #1440 from rolisz/download
Return a Response with a status if the task is not yet ready.
pull/1520/head
Hiroki Nakayama
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
0 deletions
-
backend/api/views/export_dataset.py
|
@ -32,6 +32,7 @@ class DownloadAPI(APIView): |
|
|
if ready: |
|
|
if ready: |
|
|
filename = task.result |
|
|
filename = task.result |
|
|
return FileResponse(open(filename, mode='rb'), as_attachment=True) |
|
|
return FileResponse(open(filename, mode='rb'), as_attachment=True) |
|
|
|
|
|
return Response({'status': 'Not ready'}) |
|
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs): |
|
|
def post(self, request, *args, **kwargs): |
|
|
project_id = self.kwargs['project_id'] |
|
|
project_id = self.kwargs['project_id'] |
|
|