From 5c1fe9fdd321998bdc3edec02a356a7d00401ebf Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 2 Sep 2024 13:00:47 +0300 Subject: Use if else to improve readabity. --- gn2/wqflask/views.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gn2') 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}" } -- cgit v1.2.3