mirror of https://github.com/JohnHammond/CTFd.git
Fix access to unreleased challenges through /chals/<id> endpoint (#689)
parent
14ea952a2a
commit
41933cc367
|
@ -133,6 +133,8 @@ def chal_view(chal_id):
|
||||||
teamid = session.get('id')
|
teamid = session.get('id')
|
||||||
|
|
||||||
chal = Challenges.query.filter_by(id=chal_id).first_or_404()
|
chal = Challenges.query.filter_by(id=chal_id).first_or_404()
|
||||||
|
if chal.hidden:
|
||||||
|
abort(404)
|
||||||
chal_class = get_chal_class(chal.type)
|
chal_class = get_chal_class(chal.type)
|
||||||
|
|
||||||
tags = [tag.tag for tag in Tags.query.add_columns('tag').filter_by(chal=chal.id).all()]
|
tags = [tag.tag for tag in Tags.query.add_columns('tag').filter_by(chal=chal.id).all()]
|
||||||
|
|
Loading…
Reference in New Issue