Skip to content

Commit eb4e6b3

Browse files
committed
Clarify some comments
1 parent 404ea64 commit eb4e6b3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • src/django_subatomic

src/django_subatomic/db.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,11 @@ def _ensure_transaction_is_open(*, using: str) -> None:
450450
needs_transaction = getattr(
451451
settings, "SUBATOMIC_AFTER_COMMIT_NEEDS_TRANSACTION", True
452452
)
453+
# Skip checks if they have been disabled.
453454
if not needs_transaction:
454455
return
455456

456-
# Fail if a transaction is required, but none exists.
457-
# Ignore test-suite transactions when checking for a transaction.
458-
# See Note [After-commit callbacks require a transaction]
457+
# Fail if we're not in a transaction.
459458
if not in_transaction(using=using):
460459
raise _MissingRequiredTransaction(database=using)
461460

0 commit comments

Comments
 (0)