From 81dc6616d3cb52be43e8a9c8341f97ab131fc8e7 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 29 Jul 2020 23:14:51 +0300 Subject: 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". --- wqflask/wqflask/api/gen_menu.py | 10 ++-------- 1 file 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 -- cgit v1.2.3