Changes between Version 2 and Version 3 of Ticket #36785, comment 5
- Timestamp:
- Dec 8, 2025, 11:04:04 PM (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36785, comment 5
v2 v3 5 5 Now that no explicit `transaction.atomic` usage is made the database error your RLS policy triggers is not allowed to reach `transaction.Atomic.__exit__` in your test which goes against its documented usage (see [https://docs.djangoproject.com/en/6.0/topics/db/transactions/#django.db.transaction.atomic Avoid catching exceptions inside atomic!]) and leaves the connection in a unusable state. 6 6 7 TL;DR your usage of `transaction.atomic` is incorrect but it was masked by `bulk_create` creating a nested `atomic` previously (which was implementation detail) and you should dothe following instead7 TL;DR your usage of `transaction.atomic` was always incorrect but it used to be masked by `bulk_create` implicit creation of a nested `atomic` (which is an implementation detail) and you should have been doing the following instead 8 8 9 9 {{{#!python