From be6430be4f685c2297d3816eb4cdf60dc5ac990b Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Sat, 9 May 2015 23:33:14 -0400 Subject: [PATCH] Allowing admins to preview challenge board --- CTFd/challenges.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CTFd/challenges.py b/CTFd/challenges.py index 27672120..3c9ed2ee 100644 --- a/CTFd/challenges.py +++ b/CTFd/challenges.py @@ -1,6 +1,6 @@ from flask import current_app as app, render_template, request, redirect, abort, jsonify, json as json_mod, url_for, session -from CTFd.utils import ctftime, authed, unix_time, get_kpm, can_view_challenges +from CTFd.utils import ctftime, authed, unix_time, get_kpm, can_view_challenges, is_admin from CTFd.models import db, Challenges, Files, Solves, WrongKeys, Keys import time @@ -10,7 +10,7 @@ import logging def init_challenges(app): @app.route('/challenges', methods=['GET']) def challenges(): - if not ctftime(): + if not is_admin() and not ctftime(): return redirect('/') if can_view_challenges(): return render_template('chals.html') @@ -19,7 +19,7 @@ def init_challenges(app): @app.route('/chals', methods=['GET']) def chals(): - if not ctftime(): + if not is_admin() and not ctftime(): return redirect('/') if can_view_challenges(): chals = Challenges.query.add_columns('id', 'name', 'value', 'description', 'category').order_by(Challenges.value).all()