aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--wqflask/wqflask/api/gen_menu.py12
2 files changed, 20 insertions, 4 deletions
diff --git a/README.md b/README.md
index 62ead0bd..972d5c50 100644
--- a/README.md
+++ b/README.md
@@ -109,6 +109,18 @@ alias runcmd="time env GN2_PROFILE=~/opt/gn-latest TMPDIR=//tmp SERVER_PORT=5004
Replace some of the env variables as per your use case.
+### Troubleshooting
+
+If the menu does not pop up check your `GN2_BASE_URL`. E.g.
+
+```
+curl http://gn2-pjotr.genenetwork.org/api/v_pre1/gen_dropdown
+```
+
+check the logs. If there is ERROR 1054 (42S22): Unknown column
+'InbredSet.Family' in 'field list' it may be you are trying the small
+database.
+
## Documentation
User documentation can be found
diff --git a/wqflask/wqflask/api/gen_menu.py b/wqflask/wqflask/api/gen_menu.py
index a699a484..5d239343 100644
--- a/wqflask/wqflask/api/gen_menu.py
+++ b/wqflask/wqflask/api/gen_menu.py
@@ -1,4 +1,8 @@
from gn3.db.species import get_all_species
+
+import utility.logger
+logger = utility.logger.getLogger(__name__)
+
def gen_dropdown_json(conn):
"""Generates and outputs (as json file) the data for the main dropdown menus on
the home page
@@ -19,16 +23,16 @@ def get_groups(species, conn):
with conn.cursor() as cursor:
for species_name, _species_full_name in species:
groups[species_name] = []
- cursor.execute(
- ("SELECT InbredSet.Name, InbredSet.FullName, "
+ query = ("SELECT InbredSet.Name, InbredSet.FullName, "
"IFNULL(InbredSet.Family, 'None') "
"FROM InbredSet, Species WHERE Species.Name = '{}' "
"AND InbredSet.SpeciesId = Species.Id GROUP by "
"InbredSet.Name ORDER BY IFNULL(InbredSet.FamilyOrder, "
"InbredSet.FullName) ASC, IFNULL(InbredSet.Family, "
"InbredSet.FullName) ASC, InbredSet.FullName ASC, "
- "InbredSet.MenuOrderId ASC")
- .format(species_name))
+ "InbredSet.MenuOrderId ASC").format(species_name)
+ # logger.debug(query)
+ cursor.execute(query)
results = cursor.fetchall()
for result in results:
family_name = "Family:" + str(result[2])