Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #927 from Half-Shot/develop
Browse files Browse the repository at this point in the history
Fall back to 'username' if 'user' is not given for appservice registration.
  • Loading branch information
erikjohnston authored Jul 18, 2016
2 parents 6344db6 + 511a52a commit 4f81edb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions synapse/rest/client/v2_alpha/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ def on_POST(self, request):
# 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

Expand Down

0 comments on commit 4f81edb

Please sign in to comment.