aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-07-29 23:14:51 +0300
committerBonfaceKilz2020-07-29 23:14:51 +0300
commit81dc6616d3cb52be43e8a9c8341f97ab131fc8e7 (patch)
tree1b21ddec356d0b7a9bf22b81d1558e771ccae813
parent36c85b7f82c584b869182f097cd0b8577dfef0d4 (diff)
downloadgenenetwork2-81dc6616d3cb52be43e8a9c8341f97ab131fc8e7.tar.gz
Update how boolean is returned
* wqflask/wqflask/api/gen_menu.py (phenotypes_exist, genotypes_exist): Convert sql result to boolean instead of only checking for "None".
-rw-r--r--wqflask/wqflask/api/gen_menu.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py
index 69a927cd..0adf3cee 100644
--- a/wqflask/wqflask/api/gen_menu.py
+++ b/wqflask/wqflask/api/gen_menu.py
@@ -93,21 +93,15 @@ def phenotypes_exist(group_name):
results = g.db.execute(
("SELECT Name FROM PublishFreeze " +
"WHERE PublishFreeze.Name = '{}'").format(group_name+"Publish")).fetchone()
+ return bool(results)
- if results != None:
- return True
- else:
- return False
def genotypes_exist(group_name):
results = g.db.execute(
("SELECT Name FROM GenoFreeze " +
"WHERE GenoFreeze.Name = '{}'").format(group_name+"Geno")).fetchone()
+ return bool(results)
- if results != None:
- return True
- else:
- return False
def build_types(species, group):
"""Fetches tissues