diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/views.py | 23 |
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__) |