From 286027a1c07c0bf6ca113715f87ee7f1380d09e0 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 16 Jun 2023 12:57:16 +0300 Subject: configs: Fix issues caught by mechanical-rob tests --- wqflask/base/data_set/utils.py | 2 +- wqflask/base/trait.py | 6 +++--- wqflask/base/webqtlConfig.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'wqflask/base') diff --git a/wqflask/base/data_set/utils.py b/wqflask/base/data_set/utils.py index 465538af..11391d69 100644 --- a/wqflask/base/data_set/utils.py +++ b/wqflask/base/data_set/utils.py @@ -27,7 +27,7 @@ def query_table_timestamp(dataset_type: str): # computation data and actions with database_connection() as conn, conn.cursor() as cursor: - fetch_db_name = parse_db_url(get_setting("SQL_URI")) + fetch_db_name = parse_db_url(get_setting(app, "SQL_URI")) cursor.execute( "SELECT UPDATE_TIME FROM " "information_schema.tables " diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 70afa2cc..3a52e889 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -172,13 +172,13 @@ class GeneralTrait: alias = 'Not available' if self.symbol: human_response = requests.get( - get_setting("GN2_BASE_URL") + "gn3/gene/aliases/" + + get_setting(app, "GN2_BASE_URL") + "gn3/gene/aliases/" + self.symbol.upper()) mouse_response = requests.get( - get_setting("GN2_BASE_URL") + "gn3/gene/aliases/" + + get_setting(app, "GN2_BASE_URL") + "gn3/gene/aliases/" + self.symbol.capitalize()) other_response = requests.get( - get_setting("GN2_BASE_URL") + "gn3/gene/aliases/" + + get_setting(app, "GN2_BASE_URL") + "gn3/gene/aliases/" + self.symbol.lower()) if human_response and mouse_response and other_response: diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 296bd314..600c6800 100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -93,6 +93,7 @@ def init_app(app): TEMPDIR, child) WEBQTL_TMPDIR = mkdir_with_temp_dir("/gn2/") app.config["WEBQTL_TMPDIR"] = WEBQTL_TMPDIR + app.config["TMPDIR"] = WEBQTL_TMPDIR app.config["WEBQTL_CACHEDIR"] = mkdir_with_temp_dir( f"{WEBQTL_TMPDIR}cache/") -- cgit v1.2.3