From 3901b2c3797d5e1bbf748a76405debb4d6382836 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Mon, 17 Oct 2022 19:16:28 -0500 Subject: [PATCH] fix error with 500 page --- files/routes/errors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/errors.py b/files/routes/errors.py index 7a91b2bee..92920df0e 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -46,6 +46,9 @@ def error_401(e): @app.errorhandler(500) def error_500(e): + if not getattr(g, 'db', None): + print(f'error 500 with no db: {request.full_path}') + return error(e) g.db.rollback() return error(e)