From 83dc666dd35a5c275c0182ae3f580a37fd67d98b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 30 Mar 2022 11:20:04 +0300 Subject: Remove double-encoding to json Passing the data into `requests.post` as a `json=...` argument will automatically encode the data to JSON and set up the correct Content-Type header. The call `json.dumps(post_data)` was pre-encoding the data to a JSON string, that was the re-encoded to JSON yet again, which is not what we want. This commit fixes that.X --- wqflask/wqflask/partial_correlations_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/partial_correlations_views.py b/wqflask/wqflask/partial_correlations_views.py index 659b49e9..41bbe7d7 100644 --- a/wqflask/wqflask/partial_correlations_views.py +++ b/wqflask/wqflask/partial_correlations_views.py @@ -236,7 +236,7 @@ def partial_correlations(): } return handle_response(requests.post( url=f"{GN_SERVER_URL}api/correlation/partial", - json=json.dumps(post_data))) + json=post_data)) for error in args["errors"]: flash(error, "alert-danger") -- cgit v1.2.3