updated verify logic to accomedate confirmed users who forgot their discord access token
This commit is contained in:
@@ -100,18 +100,21 @@ def verify_email(token):
|
|||||||
user = Participant.query.filter_by(email=email).first_or_404()
|
user = Participant.query.filter_by(email=email).first_or_404()
|
||||||
|
|
||||||
if get_confirmed_count() >= current_app.config['MAX_SPOTS']:
|
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
|
discord_link = current_app.config['DISCORD_LINK']
|
||||||
db.session.commit()
|
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."
|
||||||
|
|
||||||
discord_link = current_app.config['DISCORD_LINK']
|
return render_template('success.html', message=msg, discord_link=discord_link, discord_token=discord_token)
|
||||||
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>')
|
@bp.route('/remove/<token>')
|
||||||
@limiter.limit("5 per hour")
|
@limiter.limit("5 per hour")
|
||||||
|
|||||||
Reference in New Issue
Block a user