From f920f9ad6d74648a0f572f3e937cfe1ea6578b3f Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 12 Jul 2023 13:50:34 +0300 Subject: Bug: Retrieve configs from app, not environment Retrieve the configuration values from the application object, not from the environment. We are assured of having the configuration values set in the application - we do not have that assurance for the environment. --- gn3/db/datasets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/db/datasets.py b/gn3/db/datasets.py index 8839f2e..28fe0fe 100644 --- a/gn3/db/datasets.py +++ b/gn3/db/datasets.py @@ -4,6 +4,8 @@ This module contains functions relating to specific trait dataset manipulation import os from typing import Any +from flask import current_app as app + def retrieve_sample_list(group: str): """ Get the sample list for a group (a category that datasets belong to) @@ -14,7 +16,7 @@ def retrieve_sample_list(group: str): samplelist = [] genofile_path = ( - f'{os.environ.get("GENENETWORK_FILES", "/home/gn2/production/genotype_files/")}' + f'{app.config.get("GENENETWORK_FILES", "/home/gn2/production/genotype_files/")}' f'/genotype/{group}.geno' ) if os.path.isfile(genofile_path): -- cgit v1.2.3