From 768418258e166cfac0466d000d4f80ef20019e0e Mon Sep 17 00:00:00 2001 From: Johan Le Baut Date: Fri, 28 Jan 2022 10:26:34 +0100 Subject: [PATCH] webapp --- webapp.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/webapp.py b/webapp.py index 31d61bc..288be63 100644 --- a/webapp.py +++ b/webapp.py @@ -30,12 +30,6 @@ app = Flask(__name__) def get_form(): return render_template("landing_form.html") -@app.route("/result", methods=['POST']) -def show_result(): - pto = escape(request.form['pto']) - result = parse_response(query_axione_pto(cfg, pto)) - return render_template("result.html", pto=pto, result=result) - @app.route("/addresses/communes", methods=['GET']) def get_communes(): to_search=request.args.get('s') @@ -58,15 +52,15 @@ def get_fantoir_voies(codeInsee): @app.route("/test/address", methods=['POST']) def test_address(): - print(request.form) - # pto = escape(request.form['pto']) + commune = escape(request.form['commune']) + numeroVoie = escape(request.form['numeroVoie']) + voie = escape(request.form['voie']) # result = parse_response(query_axione_pto(cfg, pto)) return json.dumps({'success':True}), 200, {'ContentType':'application/json'} @app.route("/test/pto", methods=['POST']) def test_pto(): - print(request.form) - # pto = escape(request.form['pto']) - # result = parse_response(query_axione_pto(cfg, pto)) - return json.dumps({'success':True}), 200, {'ContentType':'application/json'} + pto = escape(request.form['pto']) + result = parse_response(query_axione_pto(cfg, pto)) + return render_template("result.html", pto=pto, result=result)