aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2023-06-14 20:21:21 +0000
committerzsloan2023-06-14 20:25:35 +0000
commitd08b9ce6dc18cc72dac2b9c3d52c4aff5a96f67f (patch)
tree544e8ef634845f90d8fc0ed4c97b98e1def05af8
parente15c81c7b3ea2ffc3650a637c913bd15b9206a67 (diff)
downloadgenenetwork2-d08b9ce6dc18cc72dac2b9c3d52c4aff5a96f67f.tar.gz
(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).
-rw-r--r--wqflask/wqflask/views.py2
1 files changed, 1 insertions, 1 deletions
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