Fix access to unreleased challenges through /chals/<id> endpoint (#689)

selenium-screenshot-testing
Benno Evers 2018-10-06 10:29:30 +02:00 committed by Kevin Chung
parent 14ea952a2a
commit 41933cc367
1 changed files with 2 additions and 0 deletions

View File

@ -133,6 +133,8 @@ def chal_view(chal_id):
teamid = session.get('id')
chal = Challenges.query.filter_by(id=chal_id).first_or_404()
if chal.hidden:
abort(404)
chal_class = get_chal_class(chal.type)
tags = [tag.tag for tag in Tags.query.add_columns('tag').filter_by(chal=chal.id).all()]