diff options
author | zsloan | 2021-11-09 19:29:52 +0000 |
---|---|---|
committer | zsloan | 2021-11-09 19:29:52 +0000 |
commit | 2fcf4d0343244936d6b066e85a1a06ebb33adf26 (patch) | |
tree | 304423b9ebe32f88e2e299cf78ce42d83491442c /wqflask | |
parent | 86a4fccfefb26738aeb054ffec4d9408aaa86ed5 (diff) | |
download | genenetwork2-2fcf4d0343244936d6b066e85a1a06ebb33adf26.tar.gz |
Temporary fix to get temp trait submission working again; maybe should be dealt with in GN3 in some way
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/show_trait/show_trait.py | 10 | ||||
-rw-r--r-- | wqflask/wqflask/templates/show_trait_details.html | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 6020bc16..678e3132 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -40,10 +40,15 @@ ONE_YEAR = 60 * 60 * 24 * 365 class ShowTrait: def __init__(self, user_id, kw): + self.admin_status = None if 'trait_id' in kw and kw['dataset'] != "Temp": self.temp_trait = False self.trait_id = kw['trait_id'] helper_functions.get_species_dataset_trait(self, kw) + self.admin_status = get_highest_user_access_role( + user_id=user_id, + resource_id=(self.resource_id or ""), + gn_proxy_url=GN_PROXY_URL) elif 'group' in kw: self.temp_trait = True self.trait_id = "Temp_" + kw['species'] + "_" + kw['group'] + \ @@ -73,10 +78,7 @@ class ShowTrait: self.trait_vals = Redis.get(self.trait_id).split() self.resource_id = get_resource_id(self.dataset, self.trait_id) - self.admin_status = get_highest_user_access_role( - user_id=user_id, - resource_id=(self.resource_id or ""), - gn_proxy_url=GN_PROXY_URL) + # ZS: Get verify/rna-seq link URLs try: blatsequence = self.this_trait.blatseq diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html index 3e59a3ee..6b125221 100644 --- a/wqflask/wqflask/templates/show_trait_details.html +++ b/wqflask/wqflask/templates/show_trait_details.html @@ -234,7 +234,7 @@ {% endif %} {% endif %} <button type="button" id="view_in_gn1" class="btn btn-primary" title="View Trait in GN1" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?cmd=show&db={{ this_trait.dataset.name }}&probeset={{ this_trait.name }}', '_blank')">Go to GN1</button> - {% if admin_status.get('metadata', DataRole.VIEW) > DataRole.VIEW %} + {% if admin_status != None and admin_status.get('metadata', DataRole.VIEW) > DataRole.VIEW %} {% if this_trait.dataset.type == 'Publish' %} <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('/datasets/{{ this_trait.dataset.id }}/traits/{{ this_trait.name }}?resource-id={{ resource_id }}', '_blank')">Edit</button> {% endif %} |