1👍
Yes, there is a way: django-allauth emits signals in various phases of the user signup process, including a signal when the user confirms their email:
allauth.account.signals.email_confirmed(request, email_address)
Adding a listener for that signal should solve your problem.
0👍
As dirkgroten mentioned, you should use the email_confirmed
signal. However, this signal is triggered both when a user confirms their address after signing up and when they add new email addresses. To only execute code in the former case, you can check if the user hasn’t logged in yet:
from allauth.account.models import EmailAddress
from allauth.account.signals import email_confirmed
@receiver(email_confirmed)
def on_email_confirmed(email_address: EmailAddress, **kwargs):
user = email_address.user
if user.last_login is None:
# New user - do something here
Source:stackexchange.com