I am working on a project utilizing Django All Auth.
Inside the package, there is an account.signals file that contains a signal.
email_confirmed = Signal(providing_args=["request", "email_address"]).
It is used inside of a model for EmailConfirmationHMAC.
def confirm(self, request):
if not self.email_address.verified:
email_address = self.email_address
get_adapter(request).confirm_email(request, email_address)
signals.email_confirmed.send(sender=self.__class__,
request=request,
email_address=email_address)
return email_address
Adding a stack trace in here, I can see it is getting to this part.
Inside my project, I have a python file receivers.py
from allauth.account.signals import email_confirmed
from django.dispatch import receiver
@receiver(email_confirmed)
def custom_logic(sender, **kwargs):
a = 0
import ipdb;
ipdb.set_trace()
if a:
pass
However, whenever I confirm an email verification my custom logic debugger is not being hit, the email is being confirmed and the page is being re-routed.
How do I ensure that my custom_logic function can be ran, after the signal is sent?
signals.email_confirmed.send(sender=self.__class__,
request=request,
email_address=email_address)
Thanks!