aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-09-20 22:45:04 +0300
committerFrederick Muriuki Muriithi2022-09-20 22:45:04 +0300
commit768c05bb521716873e0ee1050bab360f09345a5b (patch)
tree2de48ac76b4e1a25e04246f51ff14e29f4db2d69 /wqflask/base
parent4fafdfd8487ddf61105b2a5ca92534c8014c1db4 (diff)
downloadgenenetwork2-768c05bb521716873e0ee1050bab360f09345a5b.tar.gz
Revert "Use member variable `self.conn` to avoid test failure"
This reverts commit 4fafdfd8487ddf61105b2a5ca92534c8014c1db4. While using `self.conn.cursor()` works in the tests, it will not work in the application since the point of initialisation could be very different from the point where the 'property' is called.
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/species.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wqflask/base/species.py b/wqflask/base/species.py
index 403e0bbb..0ee04630 100644
--- a/wqflask/base/species.py
+++ b/wqflask/base/species.py
@@ -47,7 +47,7 @@ class Chromosomes:
def chromosomes(self) -> OrderedDict:
"""Lazily fetch the chromosomes"""
chromosomes = OrderedDict()
- with self.conn.cursor() as cursor:
+ with database_connection() as conn, conn.cursor() as cursor:
if self.species is not None:
cursor.execute(
"SELECT Chr_Length.Name, Chr_Length.OrderId, Length "