diff options
author | BonfaceKilz | 2020-07-29 23:14:51 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-07-29 23:14:51 +0300 |
commit | 81dc6616d3cb52be43e8a9c8341f97ab131fc8e7 (patch) | |
tree | 1b21ddec356d0b7a9bf22b81d1558e771ccae813 /wqflask | |
parent | 36c85b7f82c584b869182f097cd0b8577dfef0d4 (diff) | |
download | genenetwork2-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".
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/api/gen_menu.py | 10 |
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 |