[Fix] Fixed ObjectDoesNotExist for send_registration_mail, fixed duplicate mail sending (#312)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#312
This commit is contained in:
2026-01-29 20:24:11 +13:00
parent 5565b9cb9e
commit 9f63a9d4de

View File

@ -194,8 +194,6 @@ class UserManager(object):
if clean_username != username or clean_email != email:
# This will be caught by the try in view.py/register
raise ValueError("Invalid username or password")
# avoid circular import :S
from .tasks import send_registration_mail
extra_fields = {"is_active": not s.ADMIN_APPROVAL_REQUIRED}
@ -214,10 +212,6 @@ class UserManager(object):
u.default_package = p
u.save()
if not u.is_active:
# send email for verification
send_registration_mail.delay(u.pk)
if set_setting:
u.default_setting = Setting.objects.get(global_default=True)
u.save()