This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git


The following commit(s) were added to refs/heads/develop by this push:
     new 19dd6aa  AIRAVATA-3460 allow passing path as query param
19dd6aa is described below

commit 19dd6aa90f8722c7a919c961d5abbbd74bed339e
Author: Marcus Christie <[email protected]>
AuthorDate: Fri May 14 14:34:53 2021 -0400

    AIRAVATA-3460 allow passing path as query param
---
 django_airavata/apps/api/views.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/django_airavata/apps/api/views.py 
b/django_airavata/apps/api/views.py
index 91c69da..675236c 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -1535,9 +1535,12 @@ class UserStoragePathView(APIView):
     serializer_class = serializers.UserStoragePathSerializer
 
     def get(self, request, path="/", format=None):
+        # AIRAVATA-3460 Allow passing path as a query parameter instead
+        path = request.GET.get('path', path)
         return self._create_response(request, path)
 
     def post(self, request, path="/", format=None):
+        path = request.POST.get('path', path)
         if not user_storage.dir_exists(request, path):
             _, resource_path = user_storage.create_user_dir(request, path)
             # create_user_dir may create the directory with a different name
@@ -1564,6 +1567,7 @@ class UserStoragePathView(APIView):
 
     # Accept wither to replace file or to replace file content text.
     def put(self, request, path="/", format=None):
+        path = request.POST.get('path', path)
         # Replace the file if the request has a file upload.
         if 'file' in request.FILES:
             self.delete(request=request, path=path, format=format)
@@ -1581,6 +1585,7 @@ class UserStoragePathView(APIView):
         return self._create_response(request=request, path=path)
 
     def delete(self, request, path="/", format=None):
+        path = request.POST.get('path', path)
         if user_storage.dir_exists(request, path):
             user_storage.delete_dir(request, path)
         else:

Reply via email to