forked from enviPath/enviPy
[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:
@ -194,8 +194,6 @@ class UserManager(object):
|
|||||||
if clean_username != username or clean_email != email:
|
if clean_username != username or clean_email != email:
|
||||||
# This will be caught by the try in view.py/register
|
# This will be caught by the try in view.py/register
|
||||||
raise ValueError("Invalid username or password")
|
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}
|
extra_fields = {"is_active": not s.ADMIN_APPROVAL_REQUIRED}
|
||||||
|
|
||||||
@ -214,10 +212,6 @@ class UserManager(object):
|
|||||||
u.default_package = p
|
u.default_package = p
|
||||||
u.save()
|
u.save()
|
||||||
|
|
||||||
if not u.is_active:
|
|
||||||
# send email for verification
|
|
||||||
send_registration_mail.delay(u.pk)
|
|
||||||
|
|
||||||
if set_setting:
|
if set_setting:
|
||||||
u.default_setting = Setting.objects.get(global_default=True)
|
u.default_setting = Setting.objects.get(global_default=True)
|
||||||
u.save()
|
u.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user