Reputation: 2169
I'm trying to receive the user_activated signal sent by django-registration when a user account is activated. Here is my signals.py
from registration.signals import user_activated
def receiver(sender, user, request, **kwargs):
print 'received signal'
user_activated.connect(receiver, dispatch_uid='registration.signals.user_activated')
But when a user is activated the user_activated signal is sent twice. I know this because the output is
received signal
received signal
Multiple imports of signals.py shouldn't connect the signal receiver twice because I use a unique dispatch_uid, so why is the signal sent twice? Is it a problem with my code or a problem with django-registration (using the default backend)?
Upvotes: 3
Views: 780
Reputation: 1460
The dispatch_uid
just stops you from connecting to the same signal twice, but the problem is thatdjango-registration
SENDS OUT the signal twice.
To fix it, apply this patch to registration/views.py
and it should work.
Upvotes: 1