当用户帐户被激活时,我正在尝试接收 django-registration 发送的 user_activated 信号。这是我的信号.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')
但是当用户被激活时, user_activated 信号被发送两次。我知道这是因为输出是
received signal
received signal
多次导入signals.py不应该连接信号接收器两次,因为我使用了唯一的dispatch_uid,那为什么信号会发送两次呢?是我的代码有问题还是 django-registration 有问题(使用默认后端)?