1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 08:38:59 +00:00

render bot_create template when there's an error

This commit is contained in:
Lynne Megido 2019-09-11 18:37:29 +10:00
parent 63722bb7a2
commit b688186c28

View file

@ -379,8 +379,10 @@ def bot_create():
r = requests.get("https://{}/api/v1/instance".format(session['instance']), timeout=10) r = requests.get("https://{}/api/v1/instance".format(session['instance']), timeout=10)
except requests.ConnectionError: except requests.ConnectionError:
session['error'] = "Couldn't connect to https://{}.".format(session['instance']) session['error'] = "Couldn't connect to https://{}.".format(session['instance'])
return render_template("bot_create.html", error = session.pop('error', None))
except: except:
session['error'] = "An unknown error occurred while trying to load https://{}".format(session['instance']) 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: if r.status_code == 200:
j = r.json() j = r.json()