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.
2 parents 14a9741 + 781c1c2 commit d981368Copy full SHA for d981368
src/cs50/sql.py
@@ -450,6 +450,8 @@ def teardown_appcontext(exception):
450
451
# If constraint violated
452
except sqlalchemy.exc.IntegrityError as e:
453
+ if self._autocommit:
454
+ connection.execute(sqlalchemy.text("ROLLBACK"))
455
self._logger.error(termcolor.colored(_statement, "red"))
456
e = ValueError(e.orig)
457
e.__cause__ = None
0 commit comments