mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Merge Dev into Master (#591)
* Chals endpoint seperation (#572) * Separate the logic of ctftime and email confirmations and admin checking into decorators * Separate the chals endpoint into /chals and /chals/:id. Closes #552, #435. * Challenges are now loaded directly from the server before being displayed to the user. * Challenge modals now use `{{ description }}` instead of `{{ desc }}`. * 403 is now a more common status code and can indicate that a CTF has not begun or that you are not logged in. This is in addition to CSRF failures. * Update tests to new behavior * Fixing glitch if an entry chal or team id isn't defined * Markdown it (#574) * Replace Marked with Markdown-It * Update modal change (#576) * Switch update modals to use nunjucks instead of JS to load in data. * Fix previewing challenges after hitting the challenge update button. * Fix edit-files issue with an unnecessary request. * Fix solves button * Closes #592
This commit is contained in:
@@ -276,7 +276,7 @@ def test_ctftime_prevents_accessing_challenges_before_ctf():
|
||||
chal_id = chal.id
|
||||
flag = gen_flag(app.db, chal=chal.id, flag=u'flag')
|
||||
|
||||
with freeze_time("2017-10-3"):
|
||||
with freeze_time("2017-10-3"): # CTF has not started yet.
|
||||
client = login_as_user(app)
|
||||
r = client.get('/chals')
|
||||
assert r.status_code == 403
|
||||
@@ -288,8 +288,7 @@ def test_ctftime_prevents_accessing_challenges_before_ctf():
|
||||
}
|
||||
r = client.post('/chal/{}'.format(chal_id), data=data)
|
||||
data = r.get_data(as_text=True)
|
||||
data = json.loads(data)
|
||||
assert data['status'] == -1
|
||||
assert r.status_code == 403
|
||||
solve_count = app.db.session.query(app.db.func.count(Solves.id)).first()[0]
|
||||
assert solve_count == 0
|
||||
destroy_ctfd(app)
|
||||
|
||||
Reference in New Issue
Block a user