[odrs-web/production] Show the correct page on database failure



commit 684fefb8bfbf7d4ba72c5380f76cd0495deb323e
Author: Richard Hughes <richard hughsie com>
Date:   Mon Sep 26 14:16:32 2016 +0100

    Show the correct page on database failure

 flaskapp.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/flaskapp.py b/flaskapp.py
index 9875626..89fd29e 100755
--- a/flaskapp.py
+++ b/flaskapp.py
@@ -43,7 +43,8 @@ def login():
         user = db.user_get_with_login(request.form['username'],
                                       request.form['password'])
     except CursorError as e:
-        return json_error(str(e))
+        flash(str(e))
+        return render_template('error.html'), 503
     if not user:
         flash('Credentials are not valid.')
         return redirect(url_for('.login'))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]