From 992bdc78601183a71a240ccae8bd8c701d201266 Mon Sep 17 00:00:00 2001 From: John Nduli Date: Thu, 31 Oct 2024 16:50:30 +0300 Subject: fix: correct use of AI_SEARCH_ENABLED flag --- gn2/wqflask/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gn2/wqflask/views.py') diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index ab151c59..16c95ca7 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -248,10 +248,13 @@ def gsearchact(): search_type = request.args["type"] is_user_logged_in = session_info().get("user", {}).get("logged_in", False) - do_ai_search = current_app.config.get( - "AI_SEARCH_ENABLED") and is_user_logged_in + ai_search_enabled = current_app.config.get("AI_SEARCH_ENABLED") + do_ai_search = ai_search_enabled and is_user_logged_in if search_type == "gene": - return render_template("gsearch_gene.html", **result, do_ai_search=do_ai_search, result=result) + return render_template("gsearch_gene.html", **result, + ai_search_enabled=ai_search_enabled, + do_ai_search=do_ai_search, + result=result) elif search_type == "phenotype": return render_template("gsearch_pheno.html", **result) -- cgit v1.2.3