Merge pull request #1790 from minrk/409-conflict

raise 409 conflict on duplicate actions
This commit is contained in:
Carol Willing
2018-04-13 10:29:52 -07:00
committed by GitHub
3 changed files with 24 additions and 10 deletions

View File

@@ -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: