diff --git a/app/auth/views/register.py b/app/auth/views/register.py index 6740e579..1799a76f 100644 --- a/app/auth/views/register.py +++ b/app/auth/views/register.py @@ -115,7 +115,8 @@ def register(): def send_activation_email(user, next_url): - # the activation code is valid for 1h + # the activation code is valid for 1h and delete all previous codes + Session.query(ActivationCode).filter(ActivationCode.user_id == user.id).delete() activation = ActivationCode.create(user_id=user.id, code=random_string(30)) Session.commit()