From b688186c2892bbae2bdf67d03bf02512f0191366 Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 11 Sep 2019 18:37:29 +1000 Subject: [PATCH] render bot_create template when there's an error --- webui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 3bbd02f..2f88179 100644 --- a/webui.py +++ b/webui.py @@ -379,9 +379,11 @@ def bot_create(): r = requests.get("https://{}/api/v1/instance".format(session['instance']), timeout=10) except requests.ConnectionError: session['error'] = "Couldn't connect to https://{}.".format(session['instance']) + return render_template("bot_create.html", error = session.pop('error', None)) except: session['error'] = "An unknown error occurred while trying to load https://{}".format(session['instance']) - + return render_template("bot_create.html", error = session.pop('error', None)) + if r.status_code == 200: j = r.json() if "Pleroma" in j['version']: