mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Fixing view CTF after end and making it less confusing
This commit is contained in:
@@ -10,8 +10,12 @@ import logging
|
||||
def init_challenges(app):
|
||||
@app.route('/challenges', methods=['GET'])
|
||||
def challenges():
|
||||
if not is_admin() and not ctftime() and not view_after_ctf():
|
||||
return redirect('/')
|
||||
if not is_admin():
|
||||
if not ctftime():
|
||||
if view_after_ctf():
|
||||
pass
|
||||
else:
|
||||
return redirect('/')
|
||||
if can_view_challenges():
|
||||
return render_template('chals.html', ctftime=ctftime())
|
||||
else:
|
||||
@@ -19,8 +23,12 @@ def init_challenges(app):
|
||||
|
||||
@app.route('/chals', methods=['GET'])
|
||||
def chals():
|
||||
if not is_admin() and not ctftime() and not view_after_ctf():
|
||||
return redirect('/')
|
||||
if not is_admin():
|
||||
if not ctftime():
|
||||
if view_after_ctf():
|
||||
pass
|
||||
else:
|
||||
return redirect('/')
|
||||
if can_view_challenges():
|
||||
chals = Challenges.query.add_columns('id', 'name', 'value', 'description', 'category').order_by(Challenges.value).all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user