mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Hidden challenges now return 404 and can't be solved (#432)
* Hidden challenges now return 404 and can't be solved
This commit is contained in:
@@ -84,8 +84,10 @@ def get_scores(user):
|
||||
return scores['standings']
|
||||
|
||||
|
||||
def gen_challenge(db, name='chal_name', description='chal_description', value=100, category='chal_category', type='standard'):
|
||||
def gen_challenge(db, name='chal_name', description='chal_description', value=100, category='chal_category', type='standard', hidden=False):
|
||||
chal = Challenges(name, description, value, category)
|
||||
if hidden:
|
||||
chal.hidden = hidden
|
||||
db.session.add(chal)
|
||||
db.session.commit()
|
||||
return chal
|
||||
|
||||
Reference in New Issue
Block a user