Skip to content
Snippets Groups Projects
Commit 4f81edbd authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Merge pull request #927 from Half-Shot/develop

Fall back to 'username' if 'user' is not given for appservice registration.
parents 6344db65 511a52af
No related branches found
No related tags found
No related merge requests found
......@@ -132,11 +132,12 @@ class RegisterRestServlet(RestServlet):
# Set the desired user according to the AS API (which uses the
# 'user' key not 'username'). Since this is a new addition, we'll
# fallback to 'username' if they gave one.
if isinstance(body.get("user"), basestring):
desired_username = body["user"]
result = yield self._do_appservice_registration(
desired_username, request.args["access_token"][0]
)
desired_username = body.get("user", desired_username)
if isinstance(desired_username, basestring):
result = yield self._do_appservice_registration(
desired_username, request.args["access_token"][0]
)
defer.returnValue((200, result)) # we throw for non 200 responses
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment