Merge pull request #50 from ajvpot/master

Fix authentication for certain admin actions
selenium-screenshot-testing
Kevin Chung 2015-09-14 22:41:59 -04:00
commit bd4bd96ce0
1 changed files with 3 additions and 0 deletions

View File

@ -547,6 +547,7 @@ def admin_fails(teamid='all'):
@admin.route('/admin/chal/new', methods=['POST']) @admin.route('/admin/chal/new', methods=['POST'])
@admins_only
def admin_create_chal(): def admin_create_chal():
files = request.files.getlist('files[]') files = request.files.getlist('files[]')
@ -581,6 +582,7 @@ def admin_create_chal():
@admin.route('/admin/chal/delete', methods=['POST']) @admin.route('/admin/chal/delete', methods=['POST'])
@admins_only
def admin_delete_chal(): def admin_delete_chal():
challenge = Challenges.query.filter_by(id=request.form['id']).first() challenge = Challenges.query.filter_by(id=request.form['id']).first()
if challenge: if challenge:
@ -600,6 +602,7 @@ def admin_delete_chal():
@admin.route('/admin/chal/update', methods=['POST']) @admin.route('/admin/chal/update', methods=['POST'])
@admins_only
def admin_update_chal(): def admin_update_chal():
challenge = Challenges.query.filter_by(id=request.form['id']).first() challenge = Challenges.query.filter_by(id=request.form['id']).first()
challenge.name = request.form['name'] challenge.name = request.form['name']