Code

Opened 8 years ago

Closed 7 years ago

#2753 closed defect (duplicate)

Signals are picky about how senders are imported

Reported by: Joeboy Owned by: adrian
Component: Core (Other) Version: master
Severity: normal Keywords: signal, signals, sender, senders, dispatcher
Cc: django25@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This works as expected:

from myproject.myapp import models as myapp_app
dispatcher.connect( myfunction, signal=signals.post_syncdb, sender=myapp_app)

This fails silently and mysteriously:

from myapp import models as myapp_app
dispatcher.connect( myfunction, signal=signals.post_syncdb, sender=myapp_app)

Thus decoupling is broken, and it takes the uninitiated user (ie. me) ages to work out what the problem is.

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by Vinay Sajip <vinay_sajip@…>

@Joe: Where did you put the above code?

comment:2 Changed 7 years ago by Joeboy

Vinay: in myproject/myapp/management.py

comment:3 Changed 7 years ago by mtredinnick

  • Resolution set to duplicate
  • Status changed from new to closed

This is a dupe of #3951 and the discussion over there explains the solution we'll implement.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.