airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal-sdk] branch master updated: AIRAVATA-3346 Restoring user_file_exists
Date Mon, 02 Nov 2020 19:38:39 GMT
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 a084291  AIRAVATA-3346 Restoring user_file_exists
a084291 is described below

commit a0842917d462afacea34edf8364f138edee28536
Author: Marcus Christie <machrist@iu.edu>
AuthorDate: Mon Nov 2 14:37:25 2020 -0500

    AIRAVATA-3346 Restoring user_file_exists
---
 airavata_django_portal_sdk/user_storage.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/airavata_django_portal_sdk/user_storage.py b/airavata_django_portal_sdk/user_storage.py
index 808830b..d98c508 100644
--- a/airavata_django_portal_sdk/user_storage.py
+++ b/airavata_django_portal_sdk/user_storage.py
@@ -202,6 +202,16 @@ def dir_exists(request, path):
         return _Datastore().dir_exists(request.user.username, path)
 
 
+def user_file_exists(request, path):
+    """If file exists, return data product URI, else None."""
+    if _Datastore().exists(request.user.username, path):
+        full_path = _Datastore().path(request.user.username, path)
+        data_product_uri = _get_data_product_uri(request, full_path)
+        return data_product_uri
+    else:
+        return None
+
+
 def delete_dir(request, path):
     """Delete path in user's data store, if it exists."""
     if _is_remote_api():


Mime
View raw message