From ff160e5c3dc05e28a98050200b089470c3233e11 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 9 Sep 2022 06:35:51 +0300 Subject: Use `database_connection()` Call the `database_connection()` function to get a connection to the database. --- wqflask/base/species.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask/base') 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 " -- cgit v1.2.3