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:
Kevin Chung
2017-10-28 13:31:34 -04:00
committed by GitHub
parent b4f29e1450
commit 6f4a520241
3 changed files with 29 additions and 1 deletions

View File

@@ -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