aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorzsloan2020-06-24 17:13:45 -0500
committerzsloan2020-06-24 17:13:45 -0500
commit645c07b98aae9508e8a0aeedd8eaca815d5daf54 (patch)
treedfb545105f95bd35fe87c549049d3833281aa6bb /wqflask/base
parent9b1aecdbb51c7cb843ca79ab430d8dc2b9d3767e (diff)
downloadgenenetwork2-645c07b98aae9508e8a0aeedd8eaca815d5daf54.tar.gz
Temporary partial fix to issue of resources without info; need to add something that automatically inserts resources with default privileges
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/trait.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 0e26ca2c..7fc016f3 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -386,13 +386,6 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
else:
the_url = "http://localhost:8080/run-action?resource={}&user={}&branch=data&action=view&trait={}".format(resource_id, g.user_session.user_id, trait.name)
- response = requests.get(the_url).content
- if response.strip() == "no-access":
- trait.view = False
- return trait
- else:
- trait_info = json.loads(response)
-
try:
response = requests.get(the_url).content
if response.strip() == "no-access":
@@ -402,7 +395,10 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
trait_info = json.loads(response)
except:
resource_info = get_resource_info(resource_id)
- default_permissions = resource_info['default_mask']['data']
+ if resource_info:
+ default_permissions = resource_info['default_mask']['data']
+ else:
+ default_permissions = webqtlConfig.DEFAULT_PRIVILEGES
if 'view' not in default_permissions:
trait.view = False
return trait