diff options
author | Frederick Muriuki Muriithi | 2023-08-31 08:01:16 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-08-31 08:01:16 +0300 |
commit | 1a2866ddf844cc1009682a3d2cff056ec3b037bb (patch) | |
tree | 4392be66240f6bc78f69a92a28ac66e6b321ec32 | |
parent | d818eaf1957c06405faf712a2be8526a7f63581b (diff) | |
download | genenetwork2-1a2866ddf844cc1009682a3d2cff056ec3b037bb.tar.gz |
Use error-display utility
Use the error-display utility to get rid of an unnecessary
error-handling function.
-rw-r--r-- | wqflask/wqflask/views.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 98c7f479..f24e033a 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -79,7 +79,7 @@ from wqflask.db_info import InfoPage from wqflask.oauth2 import client from wqflask.oauth2.client import no_token_get -from wqflask.oauth2.request_utils import process_error +from wqflask.oauth2.request_utils import with_flash_error from utility import temp_data from utility.tools import get_setting @@ -520,16 +520,13 @@ def show_trait_page(): }) dataset = request.args["dataset"] trait_id = request.args["trait_id"] - def __failure__(err): - error = process_error(err) - flash(f"{error['error']}: {error['error_description']}", "alert-error") - return render_template("show_trait_error.html") return client.post( "oauth2/data/authorisation", json={ "traits": [f"{dataset}::{trait_id}"] - }).either(__failure__, __show_trait__) + }).either(with_flash_error(render_template("show_trait_error.html")), + __show_trait__) @app.route("/heatmap", methods=('POST',)) |