diff options
-rw-r--r-- | gn3/db_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/db_utils.py b/gn3/db_utils.py index ad934d7..862d76c 100644 --- a/gn3/db_utils.py +++ b/gn3/db_utils.py @@ -4,14 +4,14 @@ from typing import Any, Iterator, Protocol, Tuple from urllib.parse import urlparse import MySQLdb as mdb import xapian -from gn3.settings import SQL_URI +from flask import current_app def parse_db_url() -> Tuple: """function to parse SQL_URI env variable note:there\ is a default value for SQL_URI so a tuple result is\ always expected""" - parsed_db = urlparse(SQL_URI) + parsed_db = urlparse(current_app.config["SQL_URI"]) return ( parsed_db.hostname, parsed_db.username, parsed_db.password, parsed_db.path[1:], parsed_db.port) |