Fall back to 'username' if 'user' is not given for appservice reg.

pull/927/head
Will Hunt 2016-07-16 15:40:21 +01:00
parent a2d288c6a9
commit e885e2a623
1 changed files with 5 additions and 3 deletions

View File

@ -134,9 +134,11 @@ class RegisterRestServlet(RestServlet):
# 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]
)
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