diff options
author | Frederick Muriuki Muriithi | 2023-06-16 10:53:08 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-06-20 13:36:50 +0300 |
commit | 883a7cba581f34eba48978746e2ff8bbb93020d8 (patch) | |
tree | 433c1b0b6db451b841810b2fdb4f2fd07bc9377b /wqflask/utility | |
parent | 7127095f2b2c54175d1360c1ddb3e0f87b6ede98 (diff) | |
download | genenetwork2-883a7cba581f34eba48978746e2ff8bbb93020d8.tar.gz |
Add `create_app()` application factory
Create the application and set up configs and other things within an
application factory function.
Fix obvious egregious errors preventing the application from starting
up correctly.
Diffstat (limited to 'wqflask/utility')
-rw-r--r-- | wqflask/utility/authentication_tools.py | 4 | ||||
-rw-r--r-- | wqflask/utility/startup_config.py | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/wqflask/utility/authentication_tools.py b/wqflask/utility/authentication_tools.py index 3d732228..0f48d26f 100644 --- a/wqflask/utility/authentication_tools.py +++ b/wqflask/utility/authentication_tools.py @@ -37,7 +37,7 @@ def check_resource_availability(dataset, user_id, trait_id=None): return webqtlConfig.SUPER_PRIVILEGES response = None - the_url = f"{get_setting('GN_PROXY_URL')}available?resource={resource_id}&user={user_id}" + the_url = f"{get_setting(app, 'GN_PROXY_URL')}available?resource={resource_id}&user={user_id}" try: response = json.loads(requests.get(the_url).content) except: @@ -94,7 +94,7 @@ def get_group_code(dataset): def check_admin(resource_id=None): the_url = ( - f"{get_setting('GN_PROXY_URL')}available?resource={resource_id}" + f"{get_setting(app, 'GN_PROXY_URL')}available?resource={resource_id}" f"&user={g.user_session.user_id}") try: response = json.loads(requests.get(the_url).content)['admin'] diff --git a/wqflask/utility/startup_config.py b/wqflask/utility/startup_config.py index 5ab43b1a..59f78d55 100644 --- a/wqflask/utility/startup_config.py +++ b/wqflask/utility/startup_config.py @@ -1,6 +1,4 @@ - -from wqflask import app - +"""Utility to print out some startup messages.""" from utility.configuration import show_settings from utility.configuration import get_setting_int from utility.configuration import get_setting |