diff options
author | Frederick Muriuki Muriithi | 2023-04-06 12:31:05 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-04-06 12:31:05 +0300 |
commit | 17abad9300e4a96a14f94da486ef8307f7d27e06 (patch) | |
tree | 38fe3bfd36be9a821adfc67b83fbbd587ceb8b5e /gn3/api/menu.py | |
parent | 3d873435f0d464864d4d691d6be4db40931fac05 (diff) | |
download | genenetwork3-17abad9300e4a96a14f94da486ef8307f7d27e06.tar.gz |
Remove deprecated `gn3.db_utils.database_connector` function
Remove the deprecated function and fix a myriad of bugs that arise from
removing the function.
Issue: https://issues.genenetwork.org/issues/bugfix_coupling_current_app_and_db_utils
Diffstat (limited to 'gn3/api/menu.py')
-rw-r--r-- | gn3/api/menu.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gn3/api/menu.py b/gn3/api/menu.py index cc77ab8..58b761e 100644 --- a/gn3/api/menu.py +++ b/gn3/api/menu.py @@ -1,14 +1,14 @@ """API for data used to generate menus""" -from flask import jsonify, Blueprint +from flask import jsonify, Blueprint, current_app from gn3.db.menu import gen_dropdown_json -from gn3.db_utils import database_connector +from gn3.db_utils import database_connection menu = Blueprint("menu", __name__) @menu.route("/generate/json") def generate_json(): """Get the menu in the JSON format""" - with database_connector() as conn: + with database_connection(current_app.config["SQL_URI"]) as conn: return jsonify(gen_dropdown_json(conn)) |