Bird
0
0

Why might a connected receiver function not be called even though the signal is sent?

medium📝 Debug Q7 of 15
Django - Signals
Why might a connected receiver function not be called even though the signal is sent?
AThe receiver function is defined inside another function and not imported
BThe signal was sent with the wrong sender argument
CThe signal was sent without any arguments
DThe receiver function returns None
Step-by-Step Solution
Solution:
  1. Step 1: Understand receiver registration scope

    If receiver is defined inside a function and not imported or executed, it won't be registered.
  2. Step 2: Effect on signal sending

    Signal sends, but no receiver is connected, so no call happens.
  3. Final Answer:

    The receiver function is defined inside another function and not imported -> Option A
  4. Quick Check:

    Receiver must be imported and registered to be called [OK]
Quick Trick: Define receivers at module level and import them [OK]
Common Mistakes:
MISTAKES
  • Assuming sender argument mismatch blocks receiver
  • Thinking empty signal args prevent calls
  • Believing return value affects signal call

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes