diff --git a/djangopasswordlessknox/signals.py b/djangopasswordlessknox/signals.py index 381dfdb..a7b39f8 100644 --- a/djangopasswordlessknox/signals.py +++ b/djangopasswordlessknox/signals.py @@ -76,6 +76,7 @@ def update_alias_verification(sender, instance, **kwargs): if ( api_settings.PASSWORDLESS_AUTO_SEND_VERIFICATION_TOKEN is True + and User.objects.filter(id=instance.id).exists() ): email_subject = ( api_settings.PASSWORDLESS_EMAIL_VERIFICATION_SUBJECT @@ -133,6 +134,7 @@ def update_alias_verification(sender, instance, **kwargs): if ( api_settings.PASSWORDLESS_AUTO_SEND_VERIFICATION_TOKEN is True + and User.objects.filter(id=instance.id).exists() ): mobile_message = api_settings.PASSWORDLESS_MOBILE_MESSAGE message_payload = {"mobile_message": mobile_message}