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:
Kevin Chung
2019-06-15 02:07:24 -04:00
committed by GitHub
parent e978867a2f
commit e627391b12
14 changed files with 336 additions and 225 deletions

View File

@@ -494,7 +494,7 @@ def test_api_user_get_me_solves_not_logged_in():
app = create_ctfd()
with app.app_context():
with app.test_client() as client:
r = client.get("/api/v1/users/me/solves")
r = client.get("/api/v1/users/me/solves", json="")
assert r.status_code == 403
destroy_ctfd(app)
@@ -569,7 +569,7 @@ def test_api_user_get_me_fails_not_logged_in():
app = create_ctfd()
with app.app_context():
with app.test_client() as client:
r = client.get("/api/v1/users/me/fails")
r = client.get("/api/v1/users/me/fails", json="")
assert r.status_code == 403
destroy_ctfd(app)
@@ -641,7 +641,7 @@ def test_api_user_get_me_awards_not_logged_in():
app = create_ctfd()
with app.app_context():
with app.test_client() as client:
r = client.get("/api/v1/users/me/awards")
r = client.get("/api/v1/users/me/awards", json="")
assert r.status_code == 403
destroy_ctfd(app)