Skip to content

Commit

Permalink
Merge branch 'main' into updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan authored Dec 17, 2023
2 parents 14a9741 + 781c1c2 commit d981368
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cs50/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ def teardown_appcontext(exception):

# If constraint violated
except sqlalchemy.exc.IntegrityError as e:
if self._autocommit:
connection.execute(sqlalchemy.text("ROLLBACK"))
self._logger.error(termcolor.colored(_statement, "red"))
e = ValueError(e.orig)
e.__cause__ = None
Expand Down

0 comments on commit d981368

Please sign in to comment.