From d08b9ce6dc18cc72dac2b9c3d52c4aff5a96f67f Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 14 Jun 2023 20:21:21 +0000 Subject: (Hopefully)fix bug where the mapping form submission is sometimes wrongly treated as a GET, causing the code to check for a hash_of_inputs input that doesn't exist. This is hard to troubleshoot because I could never reproduce the issue (only Rob has mentioned it), but the error Rob showed me seems to directly imply this was issue, so hopefully this change (which directly checks if hash_of_inputs is set) will prevent it from happening. It's possible it will still throw a different error, though (if it's actually treating it as a GET, it presumably won't have any of the other inputs it expects). This issue is a bit confusing, because I'm not sure how/why mapping run from the trait page would ever be treated as a GET request (since the show_trait page form is POST). --- wqflask/wqflask/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 86457c4e..8ac116be 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -703,7 +703,7 @@ def loading_page(): @app.route("/run_mapping", methods=('POST','GET')) def mapping_results_page(): - if request.method == "GET": + if request.method == "GET" and (hash_of_inputs := request.args.get("hash")): hash_of_inputs = request.args.get("hash") initial_start_vars = json.loads(Redis.get(hash_of_inputs)) initial_start_vars['hash_of_inputs'] = hash_of_inputs -- cgit v1.2.3