Djoser: trigger action on user account activation

I have djoser integrated on my django project, and I need to create a stripe customer_id on account activation, how can I do this?

I've been searching on djoser doc, but there is nothing about customizing activation, or passing a callback method.

Upvotes: 1

Views: 983

Answers (1)

Kamil Niski
Kamil Niski

Reputation: 4765

Djoser provides user_activated signal. It is usable just like ordinary django signal. It's undocumented but working.

Example usage

from django.dispatch import receiver

from djoser.signals import user_activated

@receiver(user_activated)
def my_handler(user, request):
    # do what you need here

Upvotes: 3

Related Questions