Skip to content

Commit 4ff9998

Browse files
committed
Rework docstring on run_after_commit
This makes it read consistently with the other docstrings in this file, separates comments on rolling back from those on raising errors, and links to docs on a related setting.
1 parent c1ec438 commit 4ff9998

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • src/django_subatomic

src/django_subatomic/db.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,13 @@ def run_after_commit(
324324
"""
325325
Register a callback to be called after the current transaction is committed.
326326
327+
(Transactions created by the test suite are deliberately ignored.)
328+
327329
If the current transaction is rolled back, the callback will not be called.
330+
328331
By default, an error will be raised if there is no transaction open.
329-
The transaction opened by tests is ignored for this purpose.
332+
While you are transitioning your codebase to stricter transaction handling,
333+
you may disable this with [`settings.SUBATOMIC_AFTER_COMMIT_NEEDS_TRANSACTION`][subatomic_after_commit_needs_transaction].
330334
331335
Note:
332336
Django's `on_commit` has a `robust` parameter, which allows a callback

0 commit comments

Comments
 (0)