about summary refs log tree commit diff
path: root/gn3/auth
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/auth')
-rw-r--r--gn3/auth/authorisation/data/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gn3/auth/authorisation/data/views.py b/gn3/auth/authorisation/data/views.py
index 043ebd6..8bfe61c 100644
--- a/gn3/auth/authorisation/data/views.py
+++ b/gn3/auth/authorisation/data/views.py
@@ -152,6 +152,7 @@ def __search_phenotypes__():
     redisuri = app.config["REDIS_URI"]
     with redis.Redis.from_url(redisuri, decode_responses=True) as redisconn:
         job_id = uuid.uuid4()
+        selected = __request_key__("selected_traits")
         command =[
             sys.executable, "-m", "scripts.search_phenotypes",
             __request_key__("species_name"),
@@ -160,10 +161,13 @@ def __search_phenotypes__():
             f"--host={__request_key__('gn3_server_uri')}",
             f"--auth-db-uri={app.config['AUTH_DB']}",
             f"--gn3-db-uri={app.config['SQL_URI']}",
-            f"--redis-uri={redisuri}"]
+            f"--redis-uri={redisuri}",
+            f"--per-page={__request_key__('per_page')}"] +(
+                [f"--selected='{json.dumps(selected)}"]
+                if len(selected) > 0 else [])
         jobs.create_job(redisconn, {
             "job_id": job_id, "command": command, "status": "queued",
-            "search_results": "[]"})
+            "search_results": tuple()})
         return jsonify({
             "job_id": job_id,
             "command_id": run_async_cmd(