mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 15:03:02 +00:00
Merge pull request #1790 from minrk/409-conflict
raise 409 conflict on duplicate actions
This commit is contained in:
@@ -70,7 +70,7 @@ class UserListAPIHandler(APIHandler):
|
||||
raise web.HTTPError(400, msg)
|
||||
|
||||
if not to_create:
|
||||
raise web.HTTPError(400, "All %i users already exist" % len(usernames))
|
||||
raise web.HTTPError(409, "All %i users already exist" % len(usernames))
|
||||
|
||||
created = []
|
||||
for name in to_create:
|
||||
@@ -127,7 +127,7 @@ class UserAPIHandler(APIHandler):
|
||||
data = self.get_json_body()
|
||||
user = self.find_user(name)
|
||||
if user is not None:
|
||||
raise web.HTTPError(400, "User %s already exists" % name)
|
||||
raise web.HTTPError(409, "User %s already exists" % name)
|
||||
|
||||
user = self.user_from_username(name)
|
||||
if data:
|
||||
|
Reference in New Issue
Block a user