From 639142e24d41c5e5a508cb1280f32fd7ff159cca Mon Sep 17 00:00:00 2001 From: Jason Held Date: Tue, 30 Jun 2020 22:54:39 -0400 Subject: [PATCH] Fixed #24816 -- Clarified docs about preventing duplicate signals. --- docs/topics/signals.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/topics/signals.txt b/docs/topics/signals.txt index 30c8299fae..b76a000b34 100644 --- a/docs/topics/signals.txt +++ b/docs/topics/signals.txt @@ -188,7 +188,11 @@ Preventing duplicate signals In some circumstances, the code connecting receivers to signals may run multiple times. This can cause your receiver function to be registered more -than once, and thus called multiple times for a single signal event. +than once, and thus called as many times for a signal event. For example, the +:meth:`~django.apps.AppConfig.ready` method may be executed more than once +during testing. More generally, this occurs everywhere your project imports the +module where you define the signals, because signal registration runs as many +times as it is imported. If this behavior is problematic (such as when using signals to send an email whenever a model is saved), pass a unique identifier as