aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kabui2022-02-01 00:29:01 +0300
committerBonfaceKilz2022-02-02 10:59:34 +0300
commitcef01360b03c433145d05ed19eb21ec6e770eb5d (patch)
treeca1947bd10ff347da334ba1e4af7312d89bfe7f4
parent5a55015a98b12f16b44f758c3f08d26ffc286313 (diff)
downloadgenenetwork3-cef01360b03c433145d05ed19eb21ec6e770eb5d.tar.gz
return 401 on request fail
-rw-r--r--gn3/api/ctl.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/gn3/api/ctl.py b/gn3/api/ctl.py
index 05cf6ff..0844c95 100644
--- a/gn3/api/ctl.py
+++ b/gn3/api/ctl.py
@@ -16,9 +16,7 @@ def run_ctl():
"""endpoint to run ctl"""
ctl_data = request.json
- results = call_ctl_script(ctl_data)
-
- return jsonify({
+ (cmd_results, response) = call_ctl_script(ctl_data)
+ return (jsonify({
"results": results
- })
-
+ }), 200) if response is not None else (jsonify({"error": str(cmd_results)}), 401)