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
parent
commit
d96c8da2ea
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions
  1. 1
      backend/api/views/export_dataset.py

1
backend/api/views/export_dataset.py

@ -32,6 +32,7 @@ class DownloadAPI(APIView):
if ready:
filename = task.result
return FileResponse(open(filename, mode='rb'), as_attachment=True)
return Response({'status': 'Not ready'})
def post(self, request, *args, **kwargs):
project_id = self.kwargs['project_id']

Loading…
Cancel
Save