This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git


The following commit(s) were added to refs/heads/master by this push:
     new b777a55  AIRAVATA-3498 Fix download bug with 2 or more nested 
directories
b777a55 is described below

commit b777a557732908e52d9ed930ccfba7c38be3e34b
Author: Marcus Christie <[email protected]>
AuthorDate: Wed Aug 18 14:52:25 2021 -0400

    AIRAVATA-3498 Fix download bug with 2 or more nested directories
---
 airavata_django_portal_sdk/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airavata_django_portal_sdk/views.py 
b/airavata_django_portal_sdk/views.py
index 884fb13..9c1f0ba 100644
--- a/airavata_django_portal_sdk/views.py
+++ b/airavata_django_portal_sdk/views.py
@@ -104,7 +104,7 @@ def _add_directory_to_zipfile(request, zf, path, 
directory=""):
         if os.path.getsize(zf.filename) > MAX_DOWNLOAD_ZIPFILE_SIZE:
             raise Exception(f"Zip file size exceeds max of 
{MAX_DOWNLOAD_ZIPFILE_SIZE} bytes")
     for d in directories:
-        _add_directory_to_zipfile(request, zf, path, d['name'])
+        _add_directory_to_zipfile(request, zf, path, os.path.join(directory, 
d['name']))
 
 
 def _add_experiment_directory_to_zipfile(request, zf, experiment_id, path, 
directory=""):
@@ -115,4 +115,4 @@ def _add_experiment_directory_to_zipfile(request, zf, 
experiment_id, path, direc
         if os.path.getsize(zf.filename) > MAX_DOWNLOAD_ZIPFILE_SIZE:
             raise Exception(f"Zip file size exceeds max of 
{MAX_DOWNLOAD_ZIPFILE_SIZE} bytes")
     for d in directories:
-        _add_experiment_directory_to_zipfile(request, zf, experiment_id, path, 
d['name'])
+        _add_experiment_directory_to_zipfile(request, zf, experiment_id, path, 
os.path.join(directory, d['name']))

Reply via email to