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 2020/11/18 15:45:33 UTC
[airavata-django-portal-sdk] branch master updated: AIRAVATA-3346
handle 404 with dir_exists
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 d72bf49 AIRAVATA-3346 handle 404 with dir_exists
d72bf49 is described below
commit d72bf49af91bd9d60ceb0d21deb743b6e06b155b
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Wed Nov 18 10:39:36 2020 -0500
AIRAVATA-3346 handle 404 with dir_exists
---
airavata_django_portal_sdk/user_storage.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/airavata_django_portal_sdk/user_storage.py b/airavata_django_portal_sdk/user_storage.py
index 9a87db9..c95ad7c 100644
--- a/airavata_django_portal_sdk/user_storage.py
+++ b/airavata_django_portal_sdk/user_storage.py
@@ -194,10 +194,10 @@ def dir_exists(request, path):
"/user-storage/~/{path}",
path_params={"path": path},
raise_for_status=False)
- if resp.status_code != 200:
+ if resp.status_code == HTTPStatus.NOT_FOUND:
return False
- else:
- return resp.json()['isDir']
+ resp.raise_for_status()
+ return resp.json()['isDir']
else:
return _Datastore().dir_exists(request.user.username, path)