aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2022-12-05 19:29:47 +0000
committerzsloan2022-12-05 19:29:47 +0000
commitffbac2d448792d5331f6e7d66c0ab6fa867a70cb (patch)
tree5046e0451b698373e9c0790106a3b86052a63f13 /wqflask
parent47f032329f967440f44889ee856f1a8510fb773c (diff)
downloadgenenetwork2-ffbac2d448792d5331f6e7d66c0ab6fa867a70cb.tar.gz
Put metadata fetching for show_trait_page in try/except to get it working again
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/views.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 91a04c62..028512dd 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -490,16 +490,21 @@ def show_trait_page():
template_vars.js_data = json.dumps(template_vars.js_data,
default=json_default_handler,
indent=" ")
- metadata = (
- template_vars.dataset.accession_id
- .bind(
- lambda idx: requests.get(
- urljoin(
- GN3_LOCAL_URL,
- f"/api/metadata/dataset/GN{idx}")
+
+ try:
+ metadata = (
+ template_vars.dataset.accession_id
+ .bind(
+ lambda idx: requests.get(
+ urljoin(
+ GN3_LOCAL_URL,
+ f"/api/metadata/dataset/GN{idx}")
+ )
)
- )
- ).json()
+ ).json()
+ except:
+ metadata = {}
+
return render_template("show_trait.html",
metadata=metadata, **template_vars.__dict__)