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 0bf9e84  AIRAVATA-3532 In addition to checking that data product 
exists, also double check it is a file
0bf9e84 is described below

commit 0bf9e843f36f0bcfc433aa337f6bfa1464ec31fe
Author: Marcus Christie <[email protected]>
AuthorDate: Fri Oct 15 13:13:42 2021 -0400

    AIRAVATA-3532 In addition to checking that data product exists, also double 
check it is a file
---
 airavata_django_portal_sdk/user_storage/api.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airavata_django_portal_sdk/user_storage/api.py 
b/airavata_django_portal_sdk/user_storage/api.py
index 294b37a..414958b 100644
--- a/airavata_django_portal_sdk/user_storage/api.py
+++ b/airavata_django_portal_sdk/user_storage/api.py
@@ -166,7 +166,7 @@ def is_input_file(request, data_product=None, 
data_product_uri=None):
     backend = get_user_storage_provider(request,
                                         owner_username=data_product.ownerName,
                                         
storage_resource_id=storage_resource_id)
-    if backend.exists(path):
+    if backend.is_file(path):
         directories, files = backend.get_metadata(path)
         rel_path = files[0]['path']
         return os.path.dirname(rel_path) == TMP_INPUT_FILE_UPLOAD_DIR
@@ -286,7 +286,7 @@ def exists(request, data_product=None, 
data_product_uri=None):
         backend = get_user_storage_provider(request,
                                             
owner_username=data_product.ownerName,
                                             
storage_resource_id=storage_resource_id)
-        return backend.exists(path)
+        return backend.is_file(path)
 
 
 def dir_exists(request, path, storage_resource_id=None, experiment_id=None):

Reply via email to