mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Prevent users from nulling out profile values (#1125)
* Prevent users from nulling out profile values
This commit is contained in:
@@ -379,6 +379,14 @@ def test_api_team_patch_me_logged_in_admin_captain():
|
||||
|
||||
app.db.session.commit()
|
||||
with login_as_user(app, name="admin") as client:
|
||||
# Users can't null out their team name
|
||||
r = client.patch(
|
||||
"/api/v1/teams/me", json={"name": None}
|
||||
)
|
||||
resp = r.get_json()
|
||||
assert r.status_code == 400
|
||||
assert resp["errors"]["name"] == ["Field may not be null."]
|
||||
|
||||
r = client.patch(
|
||||
"/api/v1/teams/me", json={"name": "team_name", "affiliation": "changed"}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user