aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorzsloan2020-03-03 15:37:19 -0600
committerzsloan2020-03-03 15:37:19 -0600
commitcf49e1ea02568fa9b31505c08e68baf844703c15 (patch)
tree932c7908ef2f7ed5bca55b64c4ec829cade1d13f /wqflask/base/trait.py
parenteda3b9d1ed752ef644914ebcff32f861ebb1d096 (diff)
downloadgenenetwork2-cf49e1ea02568fa9b31505c08e68baf844703c15.tar.gz
Forgot to replace code referring to hmac function user_manager
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r--wqflask/base/trait.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 7ec764d8..c9dfe780 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -13,6 +13,7 @@ from base.webqtlCaseData import webqtlCaseData
from base.data_set import create_dataset
from db import webqtlDatabaseFunction
from utility import webqtlUtil
+from utility import hmac
from wqflask import app
@@ -25,8 +26,6 @@ from flask import Flask, g, request, url_for
from utility.logger import getLogger
logger = getLogger(__name__ )
-from wqflask import user_manager
-
class GeneralTrait(object):
"""
Trait class defines a trait in webqtl, can be either Microarray,
@@ -304,7 +303,7 @@ def jsonable_table_row(trait, dataset_name, index):
additive = "N/A"
else:
additive = "%.3f" % round(float(trait.additive), 2)
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.symbol,
@@ -320,7 +319,7 @@ def jsonable_table_row(trait, dataset_name, index):
else:
additive = "%.2f" % round(float(trait.additive), 2)
if trait.pubmed_id:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.description_display,
@@ -330,7 +329,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
else:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.description_display,
@@ -340,7 +339,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
elif dataset.type == "Geno":
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + hmac.hmac_creation('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.location_repr]