mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Fixing view challenges before CTF started if view_after_ctf is enabled
This commit is contained in:
@@ -26,7 +26,6 @@ def challenges_view():
|
|||||||
else: # We are NOT allowed to view after the CTF ends
|
else: # We are NOT allowed to view after the CTF ends
|
||||||
errors.append('{} has ended'.format(ctf_name()))
|
errors.append('{} has ended'.format(ctf_name()))
|
||||||
return render_template('chals.html', errors=errors, start=int(start), end=int(end))
|
return render_template('chals.html', errors=errors, start=int(start), end=int(end))
|
||||||
return redirect(url_for('views.static_html'))
|
|
||||||
if get_config('verify_emails') and not is_verified(): # User is not confirmed
|
if get_config('verify_emails') and not is_verified(): # User is not confirmed
|
||||||
return redirect(url_for('auth.confirm_user'))
|
return redirect(url_for('auth.confirm_user'))
|
||||||
if user_can_view_challenges(): # Do we allow unauthenticated users?
|
if user_can_view_challenges(): # Do we allow unauthenticated users?
|
||||||
@@ -47,7 +46,7 @@ def chals():
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
return redirect(url_for('views.static_html'))
|
return redirect(url_for('views.static_html'))
|
||||||
if user_can_view_challenges():
|
if user_can_view_challenges() and (ctf_started() or is_admin()):
|
||||||
chals = Challenges.query.filter(or_(Challenges.hidden != True, Challenges.hidden == None)).add_columns('id', 'name', 'value', 'description', 'category').order_by(Challenges.value).all()
|
chals = Challenges.query.filter(or_(Challenges.hidden != True, Challenges.hidden == None)).add_columns('id', 'name', 'value', 'description', 'category').order_by(Challenges.value).all()
|
||||||
|
|
||||||
json = {'game':[]}
|
json = {'game':[]}
|
||||||
|
|||||||
Reference in New Issue
Block a user