Marking 1.0.0 (#196)

* Use <int:xxx> in routes to prevent some errors 500 (#192)

* Use first_or_404() to prevent some errors 500 (#193)

* Add a populating script for awards. (#191)

* Creating upload_file util

* Marking 1.0.0 in __init__ and starting database migrations

* Upgrading some more HTML

* Adding CHANGELOG.md
This commit is contained in:
Kevin Chung
2017-01-24 23:06:16 -05:00
committed by GitHub
parent 01cb189b22
commit 935027c55d
21 changed files with 482 additions and 110 deletions

View File

@@ -79,7 +79,7 @@ def solves_per_chal():
@challenges.route('/solves')
@challenges.route('/solves/<teamid>')
@challenges.route('/solves/<int:teamid>')
def solves(teamid=None):
solves = None
awards = None
@@ -131,7 +131,7 @@ def attempts():
return jsonify(json)
@challenges.route('/fails/<teamid>', methods=['GET'])
@challenges.route('/fails/<int:teamid>', methods=['GET'])
def fails(teamid):
fails = WrongKeys.query.filter_by(teamid=teamid).count()
solves = Solves.query.filter_by(teamid=teamid).count()
@@ -140,7 +140,7 @@ def fails(teamid):
return jsonify(json)
@challenges.route('/chal/<chalid>/solves', methods=['GET'])
@challenges.route('/chal/<int:chalid>/solves', methods=['GET'])
def who_solved(chalid):
if not user_can_view_challenges():
return redirect(url_for('auth.login', next=request.path))
@@ -151,7 +151,7 @@ def who_solved(chalid):
return jsonify(json)
@challenges.route('/chal/<chalid>', methods=['POST'])
@challenges.route('/chal/<int:chalid>', methods=['POST'])
def chal(chalid):
if ctf_ended() and not view_after_ctf():
return redirect(url_for('challenges.challenges_view'))
@@ -178,7 +178,7 @@ def chal(chalid):
# Challange not solved yet
if not solves:
chal = Challenges.query.filter_by(id=chalid).first()
chal = Challenges.query.filter_by(id=chalid).first_or_404()
key = unicode(request.form['key'].strip().lower())
keys = json.loads(chal.flags)