django - Receiving duplicate signals. How to search for the cause? -


i have wrote django signal in __init__.py of project. looks this:

from django.db.models.signals import post_save paypal.standard.ipn.models import paypalipn  def confirm_paypal_payment(sender, **kwargs):      obj = kwargs['instance']     ...     ...  post_save.connect(confirm_paypal_payment, sender=paypalipn, dispatch_uid="confirm_paypal_payment") 

this signal waits saves in model, https://github.com/spookylukey/django-paypal/blob/master/paypal/standard/ipn/models.py

i'm stuck , cannot understand why continue receive duplicate signals, i've read documentation , said should use dispatch_uid prevent this. using dispatch_uid continue receive duplicate signals.

any ideas on how find root cause this? i'm using django 1.6.2.

move out of __init__.py , save either signals.py (a new file in app directory, same place views.py) or in models.py, recommended in documentation:

you can put signal handling , registration code anywhere like. however, you’ll need make sure module it’s in gets imported on signal handling gets registered before signals need sent. makes app’s models.py place put registration of signal handlers.

the __init__.py bad place put code this, because there chance executed more once.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -