mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Fix creating users from the admin panel while name changes disabled (#862)
* Fix creating users from the admin panel while name changes are disabled; clean up user & team schema validators * Closes #832 * Coerce /api/v1/teams/<team_id> to /api/v1/teams/<int:team_id>
This commit is contained in:
@@ -98,7 +98,7 @@ def register_user(app, name="user", email="user@ctfd.io", password="password", r
|
||||
assert sess['nonce']
|
||||
|
||||
|
||||
def register_team(app, name="team", password="password"):
|
||||
def register_team(app, name="team", password="password", raise_for_error=True):
|
||||
with app.app_context():
|
||||
with app.test_client() as client:
|
||||
r = client.get('/team')
|
||||
@@ -108,7 +108,10 @@ def register_team(app, name="team", password="password"):
|
||||
"password": password,
|
||||
"nonce": sess.get('nonce')
|
||||
}
|
||||
client.post('/teams/new', data=data)
|
||||
r = client.post('/teams/new', data=data)
|
||||
if raise_for_error:
|
||||
assert r.status_code == 302
|
||||
return client
|
||||
|
||||
|
||||
def login_as_user(app, name="user", password="password", raise_for_error=True):
|
||||
|
||||
Reference in New Issue
Block a user