summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-07-15 19:39:18 +0100
committerDavid Baker <dave@matrix.org>2015-07-15 19:39:18 +0100
commit09489499e7e4e61cd3fcf735584355ba1f780a5c (patch)
treec30e1d22c147e2fed4a4b4375e0cedd4809f3f92
parentAdd back in support for remembering parameters submitted to a user-interactiv... (diff)
downloadsynapse-09489499e7e4e61cd3fcf735584355ba1f780a5c.tar.xz
pep8 + debug line
-rw-r--r--synapse/rest/client/v2_alpha/register.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index fa44572b7b..0c737d73b8 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -57,16 +57,18 @@ class RegisterRestServlet(RestServlet):
         yield run_on_reactor()
 
         body = parse_request_allow_empty(request)
-        # we do basic sanity checks here because the auth layerwill store these in sessions
+        # we do basic sanity checks here because the auth
+        # layer will store these in sessions
         if 'password' in body:
-            print "%r" % (body['password'])
-            if (not isinstance(body['password'], str) and
-                    not isinstance(body['password'], unicode)) or len(body['password']) > 512:
+            if ((not isinstance(body['password'], str) and
+                    not isinstance(body['password'], unicode)) or
+                    len(body['password']) > 512):
                 raise SynapseError(400, "Invalid password")
 
         if 'username' in body:
-            if (not isinstance(body['username'], str) and
-                    not isinstance(body['username'], unicode)) or len(body['username']) > 512:
+            if ((not isinstance(body['username'], str) and
+                    not isinstance(body['username'], unicode)) or
+                    len(body['username']) > 512):
                 raise SynapseError(400, "Invalid username")
             desired_username = body['username']
             yield self.registration_handler.check_username(desired_username)