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/08/04 16:24:44 UTC
[airavata-django-portal-sdk] 02/04: AIRAVATA-3420 Utility method to
get the default storage id
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 4e977dbb3d869fb7039c4b9d0dfcca7c539e0861
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Aug 4 12:05:23 2021 -0400
AIRAVATA-3420 Utility method to get the default storage id
Storage id is set on the ExperimentModel so provide a proper function to get it.
---
airavata_django_portal_sdk/user_storage/api.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/airavata_django_portal_sdk/user_storage/api.py b/airavata_django_portal_sdk/user_storage/api.py
index 252ce0d..7b0b85f 100644
--- a/airavata_django_portal_sdk/user_storage/api.py
+++ b/airavata_django_portal_sdk/user_storage/api.py
@@ -74,6 +74,11 @@ def get_user_storage_provider(request, owner_username=None, storage_resource_id=
return instance
+def get_default_storage_resource_id(request):
+ backend = get_user_storage_provider(request)
+ return backend.storage_resource_id
+
+
def save(request, path, file, name=None, content_type=None, storage_resource_id=None, experiment_id=None):
"""
Save file in path in the user's storage and return DataProduct. If