Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def run_instance():
challenge_name = request.form.get("challenge_name", None)

# Disable captcha on debug mode
if not current_app.config["ENABLE_RECAPTCHA"] and not recaptcha.verify():
if not current_app.config["DEBUG"] and current_app.config["ENABLE_RECAPTCHA"] and not recaptcha.verify():
flash("Captcha failed.", "red")
return redirect(url_for('index'))

Expand All @@ -222,8 +222,8 @@ def run_instance():
flash("The challenge name is not valid.", "red")
return redirect(url_for('index'))

if get_challenge_count_per_team(session["team_id"]) >= MAX_CHALLENGES_PER_TEAM:
flash(f"Your team has reached the maximum number of concurrent running instances ({MAX_CHALLENGES_PER_TEAM}).", "red")
if get_challenge_count_per_team(session["team_id"]) >= MAX_INSTANCE_PER_TEAM:
flash(f"Your team has reached the maximum number of concurrent running instances ({MAX_INSTANCE_PER_TEAM}).", "red")
return redirect(url_for('index'))

remove_user_running_instance(session["user_id"])
Expand Down