Skip to content

Commit

Permalink
Fix 500 error handler database rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jul 1, 2024
1 parent 7ec8d77 commit 0e53c29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/baseframe/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e53c29

Please sign in to comment.