summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorWill Hunt <half-shot@molrams.com>2016-07-16 18:37:34 +0100
committerWill Hunt <half-shot@molrams.com>2016-07-16 18:44:08 +0100
commit511a52afc8325504a69a3680e38b300dae7fd089 (patch)
tree5ee7241f11e9b5a9f2ab5ba380311ce9be66ef56 /synapse/rest
parentFall back to 'username' if 'user' is not given for appservice reg. (diff)
downloadsynapse-511a52afc8325504a69a3680e38b300dae7fd089.tar.xz
Use body.get to check for 'user'
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v2_alpha/register.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index 8da73a8615..e8d34b06b0 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -132,8 +132,7 @@ 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"]
+            desired_username = body.get("user", desired_username)
 
             if isinstance(desired_username, basestring):
                 result = yield self._do_appservice_registration(