Skip to content

Commit f0f7b40

Browse files
rollback on exception in sample app
1 parent f586a56 commit f0f7b40

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)