aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-04-12 11:57:41 +0300
committerFrederick Muriuki Muriithi2022-04-12 11:57:41 +0300
commit21ef95965bda7304e485fbf9b3b55c7eb2c787b8 (patch)
treec9ef1cdd5c19288e44999ce7b714f182c06e2a1c
parent1f635999286485c692973711e5fa834322774dc0 (diff)
downloadgenenetwork2-21ef95965bda7304e485fbf9b3b55c7eb2c787b8.tar.gz
Remove unused database code
Remove code for connecting to the database that is not actually used in the application in any sensible form.
-rw-r--r--wqflask/wqflask/database.py11
-rw-r--r--wqflask/wqflask/views.py3
2 files changed, 0 insertions, 14 deletions
diff --git a/wqflask/wqflask/database.py b/wqflask/wqflask/database.py
index 9f659ae6..c89216cf 100644
--- a/wqflask/wqflask/database.py
+++ b/wqflask/wqflask/database.py
@@ -27,17 +27,6 @@ def sql_uri():
"GN2_SETTINGS", os.path.abspath("../etc/default_settings.py")),
"SQL_URI"))
-engine = create_engine(sql_uri(), encoding="latin1")
-
-db_session = scoped_session(sessionmaker(autocommit=False,
- autoflush=False,
- bind=engine))
-Base = declarative_base()
-Base.query = db_session.query_property()
-
-# Initialise the db
-Base.metadata.create_all(bind=engine)
-
def parse_db_url(sql_uri: str) -> Tuple:
"""
Parse SQL_URI env variable from an sql URI
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 31e31875..1dd654df 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -98,8 +98,6 @@ from utility.benchmark import Bench
from pprint import pformat as pf
-from wqflask.database import db_session
-
import utility.logger
@@ -120,7 +118,6 @@ def connect_db():
def shutdown_session(exception=None):
db = getattr(g, '_database', None)
if db is not None:
- db_session.remove()
g.db.dispose()
g.db = None