Skip to content

Commit 9bec32a

Browse files
rollback on exception in sample app
1 parent d7979b9 commit 9bec32a

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
@@ -274,6 +274,7 @@ def postgres_insert_orm_no_autocommit_rollback(request, *args, **kwargs):
274274
transaction.rollback(using="postgres")
275275
except Exception:
276276
transaction.set_autocommit(True, using="postgres")
277+
transaction.rollback()
277278
raise
278279

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

0 commit comments

Comments
 (0)