aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-04-19 14:42:31 +0300
committerFrederick Muriuki Muriithi2023-04-19 15:13:04 +0300
commit9a0c6fd1759e13fa7a934852f87e9aa4c62d7dfd (patch)
treeb21dd6bfa8896332d848992cb32e2119cc6d9c4f /gn3/auth
parent85610fc9670c0496bff045be0e148e3d2b3357d3 (diff)
downloadgenenetwork3-9a0c6fd1759e13fa7a934852f87e9aa4c62d7dfd.tar.gz
auth: Setup selected traits correctly
Fix bugs with setting up of the selected traits for use while filtering the search results.
Diffstat (limited to 'gn3/auth')
-rw-r--r--gn3/auth/authorisation/data/phenotypes.py2
-rw-r--r--gn3/auth/authorisation/data/views.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/gn3/auth/authorisation/data/phenotypes.py b/gn3/auth/authorisation/data/phenotypes.py
index 3ba478a..db16699 100644
--- a/gn3/auth/authorisation/data/phenotypes.py
+++ b/gn3/auth/authorisation/data/phenotypes.py
@@ -17,6 +17,8 @@ def linked_phenotype_data(
authcursor.execute("SELECT * FROM linked_phenotype_data")
linked = tuple(tuple(row[key] for key in authkeys)
for row in authcursor.fetchall())
+ if len(linked) <= 0:
+ return (item for item in tuple())
paramstr = "".join(["(%s, %s, %s, %s)"] * len(linked))
query = (
"SELECT spc.SpeciesId, spc.SpeciesName, iset.InbredSetId, "
diff --git a/gn3/auth/authorisation/data/views.py b/gn3/auth/authorisation/data/views.py
index a14e78b..a9861d2 100644
--- a/gn3/auth/authorisation/data/views.py
+++ b/gn3/auth/authorisation/data/views.py
@@ -163,7 +163,7 @@ def __search_phenotypes__():
f"--gn3-db-uri={app.config['SQL_URI']}",
f"--redis-uri={redisuri}",
f"--per-page={__request_key__('per_page')}"] +(
- [f"--selected='{json.dumps(selected)}"]
+ [f"--selected={json.dumps(selected)}"]
if len(selected) > 0 else [])
jobs.create_job(redisconn, {
"job_id": job_id, "command": command, "status": "queued",