fix error with 500 page

master
justcool393 2022-10-17 19:16:28 -05:00
parent 39545e556f
commit 3901b2c379
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ def error_401(e):
@app.errorhandler(500) @app.errorhandler(500)
def error_500(e): 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() g.db.rollback()
return error(e) return error(e)