aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation/data/views.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-04-18 14:10:02 +0300
committerFrederick Muriuki Muriithi2023-04-18 14:10:47 +0300
commit280f7970f3a63c2afa06f55ad59233260da2e2b9 (patch)
tree2d0aec01b2560508a83d8d1ed0466a76263cd3a1 /gn3/auth/authorisation/data/views.py
parent0958648c62452a53d0f66d7401261015e39d2fb8 (diff)
downloadgenenetwork3-280f7970f3a63c2afa06f55ad59233260da2e2b9.tar.gz
auth: Pass `--per-page` and `--selected` options.
Diffstat (limited to 'gn3/auth/authorisation/data/views.py')
-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(