mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
skip existing users on bulk user creation
rather than aborting if any already exist if no users are to be created, throw 400
This commit is contained in:
@@ -177,6 +177,17 @@ def test_add_multi_user(app):
|
||||
data=json.dumps({'usernames': names}),
|
||||
)
|
||||
assert r.status_code == 400
|
||||
|
||||
names = ['a', 'b', 'ab']
|
||||
|
||||
# try to create the same users again
|
||||
r = api_request(app, 'users', method='post',
|
||||
data=json.dumps({'usernames': names}),
|
||||
)
|
||||
assert r.status_code == 201
|
||||
reply = r.json()
|
||||
r_names = [ user['name'] for user in reply ]
|
||||
assert r_names == ['ab']
|
||||
|
||||
|
||||
def test_add_multi_user_admin(app):
|
||||
|
Reference in New Issue
Block a user