[Django] #33190: If signals will be executed when running loaddata, then provide a warning

73 views
Skip to first unread message

Django

unread,
Oct 11, 2021, 11:32:51 AM10/11/21
to django-...@googlegroups.com
#33190: If signals will be executed when running loaddata, then provide a warning
-----------------------------------------+------------------------
Reporter: Dan Swain | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
I just got burned when loading a large fixture file: the loading of the
file caused email confirmations for registration for an event that was
held last year to be sent again because the sending of the confirmations
happened in a post_save signal.

Without debating the merits of signals (this code should obviously not
have been put into a signal), as a feature request, I would like to see
loaddata check for the possible execution of signals. If possible
execution of signals is detected, then loaddata should stop running and
display a message that signals might be triggered. The user could then
either temporarily comment out any signals in the code and re-run loaddata
(likely the most desired behavior), or they should be required to specify
an override flag if re-executing loaddata without commenting out signals
(something like loaddata fixture_name --execute-signals).

--
Ticket URL: <https://code.djangoproject.com/ticket/33190>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 12, 2021, 12:11:23 AM10/12/21
to django-...@googlegroups.com
#33190: If signals will be executed when running loaddata, then provide a warning
-------------------------------------+-------------------------------------

Reporter: Dan Swain | Owner: nobody
Type: New feature | Status: closed
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate
* component: Uncategorized => Core (Management commands)


Comment:

Duplicate of #8399. You may use `raw` to disable the handler during
fixture loading, see [https://docs.djangoproject.com/en/dev/ref/django-
admin/#what-s-a-fixture docs] and #20136.

--
Ticket URL: <https://code.djangoproject.com/ticket/33190#comment:1>

Reply all
Reply to author
Forward
0 new messages