Make captureOnCommitCallbacks capture callbacks added by callbacks
— at Version 6
Sometimes there's a need to add additional on_commit callback from on_commit callback. For example, on_commit callback saves some model, but post_save handler for that model also uses on_commit callback to perform some additional action (e.g. spawn celery task). Current Django TestCase code ignores new callbacks added during on_commit callback execution.
I present a simple solution for this problem:
https://github.com/django/django/pull/14796
Change History
(6)
Cc: |
Adam Johnson added
|
Triage Stage: |
Unreviewed → Accepted
|
Summary: |
Support post-commit hooks adding more post-commit hooks → Make captureOnCommitCallbacks capture callbacks added by callbacks
|
Owner: |
changed from nobody to Evgenii Morozov
|
Status: |
new → assigned
|
Needs documentation: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Description: |
modified (diff)
|
Sounds reasonable. Thanks!