From 6e37dde5dadcc1609db81c212018c76d0891731c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 29 Sep 2026 11:33:58 -0500 Subject: Pass the 'AUTH_DB' config to the SQLite function(s). The `with_db_connection(...)` function in this module is the SQLite version, not the MariaDB version, therefore we need to pass the file to the SQLite database file and not the MariaDB connection string. --- gn_auth/auth/authorisation/data/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gn_auth/auth/authorisation/data/views.py b/gn_auth/auth/authorisation/data/views.py index 0ffc08e..512e5d8 100644 --- a/gn_auth/auth/authorisation/data/views.py +++ b/gn_auth/auth/authorisation/data/views.py @@ -206,7 +206,7 @@ def __search_mrna__(): ungrouped_mrna_data, gn3conn=gn3conn, search_query=query, selected=__request_key_list__("selected"), limit=limit, offset=offset) - return jsonify(with_db_connection(app.config["SQL_URI"], __ungrouped__)) + return jsonify(with_db_connection(app.config["AUTH_DB"], __ungrouped__)) def __request_key__(key: str, default: Any = ""): if bool(request_json()): @@ -231,7 +231,7 @@ def __search_genotypes__(): ungrouped_genotype_data, gn3conn=gn3conn, search_query=query, selected=__request_key_list__("selected"), limit=limit, offset=offset) - return jsonify(with_db_connection(app.config["SQL_URI"], __ungrouped__)) + return jsonify(with_db_connection(app.config["AUTH_DB"], __ungrouped__)) def __search_phenotypes__(): # launch the external process to search for phenotypes @@ -306,7 +306,7 @@ def link_genotypes() -> Response: return link_genotype_data(conn, group_by_id(conn, group_id), datasets) return jsonify(with_db_connection( - app.config["SQL_URI"], + app.config["AUTH_DB"], partial(__link__, **__values__(request_json())))) @data.route("/link/mrna", methods=["POST"]) @@ -332,7 +332,7 @@ def link_mrna() -> Response: return link_mrna_data(conn, group_by_id(conn, group_id), datasets) return jsonify(with_db_connection( - app.config["SQL_URI"], + app.config["AUTH_DB"], partial(__link__, **__values__(request_json())))) @data.route("/link/phenotype", methods=["POST"]) @@ -375,5 +375,5 @@ def link_phenotype() -> Response: pheno_traits_from_db(gn3conn, traits)) return jsonify(with_db_connection( - app.config["SQL_URI"], + app.config["AUTH_DB"], partial(__link__, **__values__(request_json())))) -- cgit 1.4.1