Skip to content

Commit

Permalink
Reverts db.session.is_active
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Sep 19, 2024
1 parent 2f0dec3 commit 2bded1e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions superset/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,7 @@ def wrapped(*args: Any, **kwargs: Any) -> Any:
db.session.commit() # pylint: disable=consider-using-transaction
return result
except Exception as ex:
# An error can happen before the session becomes active
if db.session.is_active:
db.session.rollback() # pylint: disable=consider-using-transaction
db.session.rollback() # pylint: disable=consider-using-transaction

if on_error:
return on_error(ex)
Expand Down

0 comments on commit 2bded1e

Please sign in to comment.