delete activation code before sending email to avoid any delay

This commit is contained in:
Son 2021-12-29 10:26:42 +01:00
parent 80b0af91e5
commit 733a9c42b0
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,6 @@ def activate():
user = activation_code.user
user.activated = True
login_user(user)
email_utils.send_welcome_email(user)
# activation code is to be used only once
ActivationCode.delete(activation_code.id)
@ -55,6 +54,8 @@ def activate():
flash("Your account has been activated", "success")
email_utils.send_welcome_email(user)
# The activation link contains the original page, for ex authorize page
if "next" in request.args:
next_url = request.args.get("next")