updated verify logic to accomedate confirmed users who forgot their discord access token

This commit is contained in:
2026-01-18 11:25:10 +01:00
parent 6d9f96efd9
commit 9bde723747

View File

@@ -100,18 +100,21 @@ def verify_email(token):
user = Participant.query.filter_by(email=email).first_or_404()
if get_confirmed_count() >= current_app.config['MAX_SPOTS']:
return render_template("error.html", error_message="Sorry! The event filled up while you were verifying.")
if user.confirmed:
return render_template('success.html', message="You are confirmed", discord_link=current_app.config['DISCORD_LINK'], discord_token=user.discord_token)
else:
return render_template("error.html", error_message="Sorry! The event filled up while you were verifying.")
else:
user.confirmed = True
db.session.commit()
user.confirmed = True
db.session.commit()
discord_link = current_app.config['DISCORD_LINK']
discord_token = user.discord_token
msg = "You are confirmed!"
if user.looking_for_team:
msg += " Since you need a team, please join the #team-search channel."
return render_template('success.html', message=msg, discord_link=discord_link, discord_token=discord_token)
discord_link = current_app.config['DISCORD_LINK']
discord_token = user.discord_token
msg = "You are confirmed!"
if user.looking_for_team:
msg += " Since you need a team, please join the #team-search channel."
return render_template('success.html', message=msg, discord_link=discord_link, discord_token=discord_token)
@bp.route('/remove/<token>')
@limiter.limit("5 per hour")