mirror of https://github.com/JohnHammond/CTFd.git
Merge pull request #50 from ajvpot/master
Fix authentication for certain admin actionsselenium-screenshot-testing
commit
bd4bd96ce0
|
@ -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']
|
||||||
|
|
Loading…
Reference in New Issue