Opened 3 years ago

Closed 3 years ago

#33190 closed New feature (duplicate)

If signals will be executed when running loaddata, then provide a warning

Reported by: Dan Swain Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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).

Change History (1)

comment:1 by Mariusz Felisiak, 3 years ago

Component: UncategorizedCore (Management commands)
Resolution: duplicate
Status: newclosed

Duplicate of #8399. You may use raw to disable the handler during fixture loading, see docs and #20136.

Note: See TracTickets for help on using tickets.
Back to Top