From 0e53c295e56629fb9bfe6ca92e9e9e3aafe09699 Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Mon, 1 Jul 2024 14:06:29 +0530 Subject: [PATCH] Fix 500 error handler database rollback --- src/baseframe/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/baseframe/errors.py b/src/baseframe/errors.py index 56243a8f..15b819e7 100644 --- a/src/baseframe/errors.py +++ b/src/baseframe/errors.py @@ -69,7 +69,7 @@ def error429(_exc: Exception) -> ReturnRenderWith: def error500(_exc: Exception) -> ReturnRenderWith: """Render a 500 error.""" if current_app.extensions and 'sqlalchemy' in current_app.extensions: - current_app.extensions['sqlalchemy'].db.session.rollback() + current_app.extensions['sqlalchemy'].session.rollback() baseframe_translations.as_default() return {'error': "500 Internal Server Error"}, 500