aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-09-09 06:35:51 +0300
committerFrederick Muriuki Muriithi2022-09-09 06:35:51 +0300
commitff160e5c3dc05e28a98050200b089470c3233e11 (patch)
treec5a2a260a13e3db50cb2050f2f418236fdafd551 /wqflask
parent1055679028cdd24f845aac80dd4cde22a17a1e25 (diff)
downloadgenenetwork2-ff160e5c3dc05e28a98050200b089470c3233e11.tar.gz
Use `database_connection()`
Call the `database_connection()` function to get a connection to the database.
Diffstat (limited to 'wqflask')
-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 "