aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance
diff options
context:
space:
mode:
authorzsloan2019-04-04 10:39:31 -0500
committerzsloan2019-04-04 10:39:31 -0500
commit91147b36c65e742d9b7f2fda95fb5969e25f6e34 (patch)
treea00f96c8b8e698918ed1caca295bc5172e80d5d4 /wqflask/maintenance
parent13698f718afd00126edcf3c0ba672fa2dbe8c94b (diff)
downloadgenenetwork2-91147b36c65e742d9b7f2fda95fb5969e25f6e34.tar.gz
Fixed issue where dataset_menu_structure.json included some groups with no visible datasets
Diffstat (limited to 'wqflask/maintenance')
-rw-r--r--wqflask/maintenance/gen_select_dataset.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
index 4d1b34a3..c590a185 100644
--- a/wqflask/maintenance/gen_select_dataset.py
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -120,10 +120,19 @@ def get_types(groups):
else:
types[species][group_name] = [("Genotypes", "Genotypes")]
if group_name in types[species]:
- types[species][group_name] += build_types(species, group_name)
- else:
- types[species][group_name] = build_types(species, group_name)
-
+ types_list = build_types(species, group_name)
+ if len(types_list) > 0:
+ types[species][group_name] += types_list
+ else:
+ types[species].pop(group_name, None)
+ groups[species] = tuple(group for group in groups[species] if group[0] != group_name)
+ else: #ZS: This whole else statement might be unnecessary, need to check
+ types_list = build_types(species, group_name)
+ if len(types_list) > 0:
+ types[species][group_name] = types_list
+ else:
+ types[species].pop(group_name, None)
+ groups[species] = tuple(group for group in groups[species] if group[0] != group_name)
return types