From 7d669eed50a0e39eaa2b4a4769e5d9bbefdb997a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 22 Jun 2023 12:12:26 +0300 Subject: Fetch configs from app object not modules --- wqflask/base/data_set/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wqflask/base/data_set/__init__.py') diff --git a/wqflask/base/data_set/__init__.py b/wqflask/base/data_set/__init__.py index e49c6a93..27955f8a 100644 --- a/wqflask/base/data_set/__init__.py +++ b/wqflask/base/data_set/__init__.py @@ -6,11 +6,12 @@ import pickle as pickle # 3rd-party imports from redis import Redis +from flask import current_app as app # local imports from .dataset import DataSet from base import webqtlConfig -from utility.tools import USE_REDIS +from utility.tools import get_setting_bool from .datasettype import DatasetType from .tempdataset import TempDataSet from .datasetgroup import DatasetGroup @@ -113,7 +114,7 @@ def datasets(group_name, this_group=None, redis_conn=Redis()): dataset_menu.append(dict(tissue=tissue_name, datasets=[(dataset, dataset_short)])) - if USE_REDIS: + if get_setting_bool(app, "USE_REDIS"): redis_conn.set(key, pickle.dumps(dataset_menu, pickle.HIGHEST_PROTOCOL)) redis_conn.expire(key, 60 * 5) -- cgit v1.2.3