diff options
author | John Nduli | 2024-08-30 12:38:29 +0300 |
---|---|---|
committer | BonfaceKilz | 2024-09-11 16:56:35 +0300 |
commit | 80d68113689f7fde09d9ddc3444f077513fb4b7d (patch) | |
tree | f16ec32ba173233037f916d36727e3653691d8e8 /gn2 | |
parent | 29ff1b6b7b00b34317e8d9764bcedd5b7dacbc02 (diff) | |
download | genenetwork2-80d68113689f7fde09d9ddc3444f077513fb4b7d.tar.gz |
fix: add flag that enables/disables search UI
Diffstat (limited to 'gn2')
-rw-r--r-- | gn2/wqflask/views.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index 5b83bb82..2383e455 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -243,12 +243,14 @@ def search_page_table(): def gsearchact(): result = GSearch(request.args).__dict__ search_type = request.args['type'] - ai_result = { - "search_term": "which animal has the same number of chromosomes as human", - "search_result": "The Bama miniature pig has the same number of chromosomes as humans", - # we need to modify the search to use url params so that we can easily link - "search_url": "https://qa.genenetwork.org/gnqna" - } + ai_result = None + if current_app.config.get("AI_SEARCH_ENABLED"): + ai_result = { + "search_term": "which animal has the same number of chromosomes as human", + "search_result": "The Bama miniature pig has the same number of chromosomes as humans", + # we need to modify the search to use url params so that we can easily link + "search_url": "https://qa.genenetwork.org/gnqna" + } if search_type == "gene": return render_template("gsearch_gene.html", **result, ai_result=ai_result) elif search_type == "phenotype": |