Skip to content

Commit d7979b9

Browse files
Merge branch 'webb/django-sql-commit' into webb/django-sql-rollback
2 parents d4c81a4 + f0f7b40 commit d7979b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/integrations/django/myapp/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ def postgres_insert_orm_no_autocommit(request, *args, **kwargs):
257257
transaction.commit(using="postgres")
258258
except Exception:
259259
transaction.set_autocommit(True, using="postgres")
260+
transaction.rollback()
260261
raise
261262

262263
transaction.set_autocommit(True, using="postgres")

0 commit comments

Comments
 (0)