diff options
author | BonfaceKilz | 2021-10-20 12:28:44 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-10-25 14:00:14 +0300 |
commit | cc3ae4707d2418712d13261d4bf9d5a509169c7e (patch) | |
tree | 79c1594e2ac248354d9fa02d31ea10b029b7760c /wqflask | |
parent | 182327254fe2964c3dd41aabe49ab99748800a64 (diff) | |
download | genenetwork2-cc3ae4707d2418712d13261d4bf9d5a509169c7e.tar.gz |
Add "GN2_PROXY" as a configurable option
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/decorators.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/wqflask/wqflask/decorators.py b/wqflask/wqflask/decorators.py index 13867cda..edbea90f 100644 --- a/wqflask/wqflask/decorators.py +++ b/wqflask/wqflask/decorators.py @@ -5,6 +5,7 @@ import redis from flask import current_app, g from typing import Dict +from urllib.parse import urljoin from functools import wraps from wqflask.access_roles import DataRole @@ -56,8 +57,10 @@ def edit_access_required(f): _user_id = g.user_session.record.get(b"user_id", "").decode("utf-8") response = json.loads( - requests.get(GN_PROXY_URL + "available?resource=" - f"{resource_id}&user={_user_id}").content) + requests.get(urljoin( + current_app.config.get("GN2_PROXY"), + ("available?resource=" + f"{resource_id}&user={_user_id}"))).content) except: response = {} if max([DataRole(role) for role in response.get( |