Skip to content

Commit b0b9bd7

Browse files
use postgres in rollback on exception
1 parent f0f7b40 commit b0b9bd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/integrations/django/myapp/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ def postgres_insert_orm_no_autocommit(request, *args, **kwargs):
256256
)
257257
transaction.commit(using="postgres")
258258
except Exception:
259+
transaction.rollback(using="postgres")
259260
transaction.set_autocommit(True, using="postgres")
260-
transaction.rollback()
261261
raise
262262

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

0 commit comments

Comments
 (0)