aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn2/wqflask/templates/wiki/genewiki.html1
-rw-r--r--gn2/wqflask/views.py16
2 files changed, 12 insertions, 5 deletions
diff --git a/gn2/wqflask/templates/wiki/genewiki.html b/gn2/wqflask/templates/wiki/genewiki.html
index 63f36741..496f5e28 100644
--- a/gn2/wqflask/templates/wiki/genewiki.html
+++ b/gn2/wqflask/templates/wiki/genewiki.html
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% block title %}GeneWiki Entry for {{ symbol }}{% endblock %}
{% block content %}
+ {{ flash_me() }}
<div class = "container">
<h1 class = "page-header">GeneWiki Entries</h1>
<p>
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index d40cfdb7..4e3c556d 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -1223,12 +1223,18 @@ def display_diffs_users():
@app.route("/genewiki/<string:symbol>")
def display_genewiki_page(symbol: str):
"""Fetch GeneRIF metadata from GN3 and display it"""
- wiki = requests.get(
- urljoin(
- GN3_LOCAL_URL,
- f"/api/metadata/wiki/{symbol}"
+ wiki = {}
+ try:
+ wiki = requests.get(
+ urljoin(
+ GN3_LOCAL_URL,
+ f"/api/metadata/wiki/{symbol}"
+ )
)
- ).json()
+ wiki.raise_for_status()
+ wiki = wiki.json()
+ except requests.RequestException as excp:
+ flash(excp, "alert-warning")
return render_template(
"wiki/genewiki.html",
symbol=symbol,