diff --git a/app.py b/app.py index 15293ad..df63994 100644 --- a/app.py +++ b/app.py @@ -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')) @@ -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"])