apragacz/django-rest-registration

user_activated not invoked

mmfnaja opened this issue · 2 comments

I am trying to trigger some external API when user is activated. For this I am trying to leverage the user_activated signal. The below is my code:

from rest_registration.api.views.register import verify_registration
from rest_registration.signals import user_activated

from app.commands import foo_command

@receiver(user_activated, sender=verify_registration)
def rr_user_activated(sender, user, **kwargs):
    foo_command(
        contact_email=user.email,
    )

What am I missing here?

Hi @mmfnaja ,
I'm afraid I can't help you - there is not enough data to answer your question. Please use one of these issue templates (I'd recommend a Bug report if you believe this is a bug) to provide necessary data so we can replicate this issue. So far I was not able to replicate it.

Looking just at the code, I think you may limit yourself by setting sender=verify_registration, but that is just a hypothesis. Current code sets the sender to None, but in next iteration it will be VerifyRegistrationView to be more concise with the conventions spelled here: https://docs.djangoproject.com/en/4.2/topics/signals/#sending-signals

Closing due to lack of response