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/06/22 20:59:36 UTC
[airavata-django-portal-sdk] 03/03: AIRAVATA-3420 Check if 'path'
in create directory response
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch mft-integration
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git
commit 45bfff18c6795eccad63edb7724ddda9e4c3a204
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Jun 22 16:55:59 2021 -0400
AIRAVATA-3420 Check if 'path' in create directory response
---
airavata_django_portal_sdk/user_storage/api.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/airavata_django_portal_sdk/user_storage/api.py b/airavata_django_portal_sdk/user_storage/api.py
index 51c2b28..17732d8 100644
--- a/airavata_django_portal_sdk/user_storage/api.py
+++ b/airavata_django_portal_sdk/user_storage/api.py
@@ -637,7 +637,10 @@ def create_user_dir(request, path="", dir_names=(), create_unique=False, storage
"/user-storage/~/{path}",
path_params={"path": path},
method="post")
- path = resp.json()['path']
+ json = resp.json()
+ # 'path' is a new response attribute, for backwards compatibility check if it exists first
+ if 'path' in json:
+ path = json['path']
# FIXME: should use the storage_resource_id returned from remote API call
return storage_resource_id, path
backend = get_user_storage_provider(request, storage_resource_id=storage_resource_id)