Search code examples
djangodjango-registration

Connecting a django-registration signal


I have a function:

def create(sender, **kw):
  [...]

Which should be called when the user_activated signal from django-registration is called.

I connect the signal and the function using this:

from registration.signals import user_activated
[...]
post_save.connect(create, sender=user_activated, dispatch_uid="users-atactivation-signal")

But the function isn't called when a user clicks on the activation link, which he got by email.

What do I miss here.


Solution

  • A function like this:

    def create(sender, user, request, **kwarg):
    [...]
    

    and a connect call like this:

    user_activated.connect(create)
    

    does the job. I have these in my signals.py file.