hotfix: userid

This commit is contained in:
te5154c
2024-02-27 23:58:57 +03:00
parent cdbe2820f3
commit ce41b31331
5 changed files with 25 additions and 20 deletions
+5 -2
View File
@@ -19,7 +19,10 @@ def errorhandler_page(_):
@app.route("/api/request")
def request_handler():
if request_string := request.args.get("request_string"):
return requests.get(f"{VATSIM_API_URL}{request_string}").json()
try:
return requests.get(f"{VATSIM_API_URL}{request_string}").json()
except requests.exceptions.JSONDecodeError:
return jsonify({"result": "not found"})
return jsonify({"result": "not found"})
@@ -31,7 +34,7 @@ def viewer_page(cid):
if "detail" in user and user["detail"] == "Not Found":
return abort(404)
return render_template("viewer.html", data=(user, ))
return render_template("viewer.html", user=user)
if __name__ == "__main__":