I present a simple solution for this problem:
https://github.com/django/django/pull/14796
--
Ticket URL: <https://code.djangoproject.com/ticket/33054>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Adam Johnson (added)
* stage: Unreviewed => Accepted
Comment:
Sounds reasonable. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:1>
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:2>
* owner: nobody => Evgenii Morozov
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:3>
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:4>
* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:5>
Old description:
> 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 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
New description:
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
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"d89f976bddb49fb168334960acc8979c3de991fa" d89f976b]:
{{{
#!CommitTicketReference repository=""
revision="d89f976bddb49fb168334960acc8979c3de991fa"
Fixed #33054 -- Made TestCase.captureOnCommitCallbacks() capture callbacks
recursively.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33054#comment:7>