We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62ad33c commit e18486cCopy full SHA for e18486c
src/cs50/sql.py
@@ -399,6 +399,8 @@ def teardown_appcontext(exception):
399
400
# If constraint violated
401
except sqlalchemy.exc.IntegrityError as e:
402
+ if self._autocommit:
403
+ connection.execute(sqlalchemy.text("ROLLBACK"))
404
self._logger.error(termcolor.colored(_statement, "red"))
405
e = ValueError(e.orig)
406
e.__cause__ = None
0 commit comments