aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-09-02 13:00:47 +0300
committerAlexander_Kabui2024-09-02 13:00:47 +0300
commit5c1fe9fdd321998bdc3edec02a356a7d00401ebf (patch)
treecd0f39b5d5c38787fca4630205c97349a2443df2
parentf3843170bb0fe4cca17b529be61fc6ae438acfb6 (diff)
downloadgenenetwork2-5c1fe9fdd321998bdc3edec02a356a7d00401ebf.tar.gz
Use if else to improve readabity.
-rw-r--r--gn2/wqflask/views.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index f0fa2750..7b1fb22d 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -340,9 +340,13 @@ def get_gnqa_history():
}
).either(
_error_, lambda x: x.json())
- response = monad_requests.get(urljoin(GN3_LOCAL_URL,
- (f"/api/llm/history?search_term={request.args.get('search_term')}"
- if request.args.get("search_term") else "/api/llm/history")),
+
+ search_term = request.args.get('search_term')
+ if search_term:
+ response_url = f"/api/llm/history?search_term={request.args.get('search_term')}"
+ else:
+ response_url = "/api/llm/history"
+ response = monad_requests.get(urljoin(GN3_LOCAL_URL, response_url),
headers={
"Authorization": f"Bearer {token}"
}