def submit(challenge): chal = Challenge.get(Challenge.id == challenge) flagval = request.form["flag"] code, message = flag.submit_flag(g.team, chal, flagval) flash(message) return redirect(url_for('challenges'))
def submit(challenge): chal = Challenge.get(Challenge.id == challenge) flagval = request.form["flag"] code, message = flag.submit_flag(g.team, chal, flagval) app.logger.info(g.user.username+" submit a flag ,challenge's name is "+chal.name) flash(message) return redirect(url_for('challenges'))
def submit_api(challenge): chal = Challenge.get(Challenge.id == challenge) flagval = request.form["flag"] code, message = flag.submit_flag(g.team, chal, flagval) return jsonify(dict(code=code, message=message))