From 43a6f8fb481107c89c9374331e676a40f8b7278d Mon Sep 17 00:00:00 2001
From: "Hartung, Michael" <michael.hartung@uni-hamburg.de>
Date: Fri, 4 Nov 2022 21:11:05 +0100
Subject: [PATCH] tissue expression request to POST to allow longer lists of
 proteins

---
 drugstone/views.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drugstone/views.py b/drugstone/views.py
index b2ef1ea..4d09f03 100755
--- a/drugstone/views.py
+++ b/drugstone/views.py
@@ -637,15 +637,15 @@ class TissueExpressionView(APIView):
     Expression of host proteins in tissues.
     """
 
-    def get(self, request) -> Response:
-        tissue = Tissue.objects.get(id=request.query_params.get('tissue'))
+    def post(self, request) -> Response:
+        tissue = Tissue.objects.get(id=request.data.get('tissue'))
 
-        if request.query_params.get('proteins'):
-            ids = json.loads(request.query_params.get('proteins'))
+        if request.data.get('proteins'):
+            ids = json.loads(request.data.get('proteins'))
             proteins = list(Protein.objects.filter(id__in=ids).all())
-        elif request.query_params.get('token'):
+        elif request.data.get('token'):
             proteins = []
-            task = Task.objects.get(token=request.query_params['token'])
+            task = Task.objects.get(token=request.data['token'])
             result = task_result(task)
             network = result['network']
             node_attributes = result.get('node_attributes')
-- 
GitLab