You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/07/29 15:41:12 UTC
[airavata-django-portal-sdk] 02/03: AIRAVATA-3485 Use experiment
owner user storage directory for listdir, get_file_metadata
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
commit bd420b84b5d2dc0ddd13feb1d4486aee4855f78e
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jul 29 11:36:00 2021 -0400
AIRAVATA-3485 Use experiment owner user storage directory for listdir, get_file_metadata
---
airavata_django_portal_sdk/user_storage/api.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/airavata_django_portal_sdk/user_storage/api.py b/airavata_django_portal_sdk/user_storage/api.py
index 413506e..c548d42 100644
--- a/airavata_django_portal_sdk/user_storage/api.py
+++ b/airavata_django_portal_sdk/user_storage/api.py
@@ -396,8 +396,8 @@ def get_file_metadata(request, path, storage_resource_id=None, experiment_id=Non
file['data-product-uri'] = file['dataProductURI']
return file
- backend = get_user_storage_provider(request, storage_resource_id=storage_resource_id)
- final_path = _get_final_path(request, path, experiment_id)
+ final_path, owner_username = _get_final_path_and_owner_username(request, path, experiment_id)
+ backend = get_user_storage_provider(request, storage_resource_id=storage_resource_id, owner_username=owner_username)
if backend.is_file(final_path):
_, files = backend.get_metadata(final_path)
file = files[0]
@@ -517,8 +517,9 @@ def listdir(request, path, storage_resource_id=None, experiment_id=None):
file['data-product-uri'] = file['dataProductURI']
return data['directories'], data['files']
- backend = get_user_storage_provider(request, storage_resource_id=storage_resource_id)
- final_path = _get_final_path(request, path, experiment_id)
+ final_path, owner_username = _get_final_path_and_owner_username(request, path, experiment_id)
+ backend = get_user_storage_provider(request, storage_resource_id=storage_resource_id,
+ owner_username=owner_username)
directories, files = backend.get_metadata(final_path)
# Mark the TMP_INPUT_FILE_UPLOAD_DIR directory as hidden in the UI
for directory in directories: