mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Improve caching (#1014)
* Cache get place code for users and teams.
* Fix score changing test helpers to clear standings cache when generating a score changing row
* `utils._get_config` will now return `KeyError` instead of None.
* Separate `/api/v1/[users,teams]/[me,id]/[solves,fails,awards]` into seperate API endpoints
* Install `Flask-DebugToolbar` in development
Main goals covered in #1012
This commit is contained in:
@@ -394,7 +394,7 @@ def test_api_team_get_me_solves_not_logged_in():
|
||||
app = create_ctfd(user_mode="teams")
|
||||
with app.app_context():
|
||||
with app.test_client() as client:
|
||||
r = client.get("/api/v1/teams/me/solves")
|
||||
r = client.get("/api/v1/teams/me/solves", json="")
|
||||
assert r.status_code == 403
|
||||
destroy_ctfd(app)
|
||||
|
||||
@@ -474,7 +474,7 @@ def test_api_team_get_me_fails_not_logged_in():
|
||||
app = create_ctfd(user_mode="teams")
|
||||
with app.app_context():
|
||||
with app.test_client() as client:
|
||||
r = client.get("/api/v1/teams/me/fails")
|
||||
r = client.get("/api/v1/teams/me/fails", json="")
|
||||
assert r.status_code == 403
|
||||
destroy_ctfd(app)
|
||||
|
||||
@@ -551,7 +551,7 @@ def test_api_team_get_me_awards_not_logged_in():
|
||||
app = create_ctfd(user_mode="teams")
|
||||
with app.app_context():
|
||||
with app.test_client() as client:
|
||||
r = client.get("/api/v1/teams/me/awards")
|
||||
r = client.get("/api/v1/teams/me/awards", json="")
|
||||
assert r.status_code == 403
|
||||
destroy_ctfd(app)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user