Opened 3 years ago
Last modified 3 years ago
#33054 closed New feature
Support post-commit hooks adding more post-commit hooks — at Initial Version
Reported by: | Evgenii Morozov | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 3.2 |
Severity: | Normal | Keywords: | on_commit |
Cc: | Adam Johnson | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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
Note:
See TracTickets
for help on using tickets.