about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2021-10-22 18:45:10 +0000
committerzsloan2021-10-22 18:53:24 +0000
commita05d0e4eb9412d9495a0f96980df27acb1526a03 (patch)
treec55eb437c304bfd373128a5f3457af8d0f529c55 /wqflask
parentf2cdd50ebd5b927d46c8fbf7f32c9ca4ea61686f (diff)
downloadgenenetwork2-a05d0e4eb9412d9495a0f96980df27acb1526a03.tar.gz
Replace hardcoded GN proxy URLs with one pulled from settings
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/utility/authentication_tools.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/wqflask/utility/authentication_tools.py b/wqflask/utility/authentication_tools.py
index 6802d689..afea69e1 100644
--- a/wqflask/utility/authentication_tools.py
+++ b/wqflask/utility/authentication_tools.py
@@ -4,11 +4,12 @@ import requests
 from flask import g
 from base import webqtlConfig
 
-
 from utility.redis_tools import (get_redis_conn,
                                  get_resource_info,
                                  get_resource_id,
                                  add_resource)
+from utility.tools import GN_PROXY_URL
+
 Redis = get_redis_conn()
 
 def check_resource_availability(dataset, trait_id=None):
@@ -24,19 +25,19 @@ def check_resource_availability(dataset, trait_id=None):
     if resource_id:
         resource_info = get_resource_info(resource_id)
 
-        # ZS: If resource isn't already in redis, add it with default
+        # If resource isn't already in redis, add it with default
         # privileges
         if not resource_info:
             resource_info = add_new_resource(dataset, trait_id)
 
-    # ZS: Check if super-user - we should probably come up with some
+    # Check if super-user - we should probably come up with some
     # way to integrate this into the proxy
     if g.user_session.user_id in Redis.smembers("super_users"):
         return webqtlConfig.SUPER_PRIVILEGES
 
     response = None
 
-    the_url = "http://localhost:8080/available?resource={}&user={}".format(
+    the_url = GN_PROXY_URL + "available?resource={}&user={}".format(
         resource_id, g.user_session.user_id)
 
     try:
@@ -93,7 +94,7 @@ def get_group_code(dataset):
 
 
 def check_admin(resource_id=None):
-    the_url = "http://localhost:8080/available?resource={}&user={}".format(
+    the_url = GN_PROXY_URL + "available?resource={}&user={}".format(
         resource_id, g.user_session.user_id)
     try:
         response = json.loads(requests.get(the_url).content)['admin']