Skip to content

Commit 6896522

Browse files
.
1 parent 52fe140 commit 6896522

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/integrations/django/myapp/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,11 @@ def postgres_insert_orm_no_autocommit(request, *args, **kwargs):
255255
username="user1",
256256
)
257257
transaction.commit(using="postgres")
258-
finally:
258+
except Exception:
259259
transaction.set_autocommit(True, using="postgres")
260+
raise
260261

262+
transaction.set_autocommit(True, using="postgres")
261263
return HttpResponse("ok {}".format(user))
262264

263265

0 commit comments

Comments
 (0)