mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Fix missing Team API exceptions (#1058)
* Add require_team decorator to endpoints that request teams. * Change status code for captain endpoints to return 403 instead of 400
This commit is contained in:
@@ -339,7 +339,7 @@ def test_api_team_patch_me_logged_in_user():
|
||||
r = client.patch(
|
||||
"/api/v1/teams/me", json={"name": "team_name", "affiliation": "changed"}
|
||||
)
|
||||
assert r.status_code == 400
|
||||
assert r.status_code == 403
|
||||
destroy_ctfd(app)
|
||||
|
||||
|
||||
@@ -640,7 +640,7 @@ def test_api_team_patch_password():
|
||||
"/api/v1/teams/me",
|
||||
json={"confirm": "password", "password": "new_password"},
|
||||
)
|
||||
assert r.status_code == 400
|
||||
assert r.status_code == 403
|
||||
|
||||
assert r.get_json() == {
|
||||
"errors": {"": ["Only team captains can edit team information"]},
|
||||
|
||||
Reference in New Issue
Block a user