summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/handlers/auth.py2
-rw-r--r--synapse/rest/client/v1/login.py6
-rw-r--r--synapse/rest/client/v2_alpha/account.py4
-rw-r--r--synapse/rest/client/v2_alpha/register.py2
4 files changed, 7 insertions, 7 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 2ea1d17ca5..620591b165 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -344,7 +344,7 @@ class AuthHandler(BaseHandler):
                     medium, threepid['medium'],
                 ),
                 errcode=Codes.UNAUTHORIZED
-             )
+            )
 
         threepid['threepid_creds'] = authdict['threepid_creds']
 
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index 8de1a02254..337ba5c02d 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -80,7 +80,7 @@ def login_id_thirdparty_from_phone(identifier):
     except phonenumbers.NumberParseException:
         raise SynapseError(400, "Unable to parse phone number")
     msisdn = phonenumbers.format_number(
-            phoneNumber, phonenumbers.PhoneNumberFormat.E164
+        phoneNumber, phonenumbers.PhoneNumberFormat.E164
     )[1:]
 
     return {
@@ -188,7 +188,7 @@ class LoginRestServlet(ClientV1RestServlet):
 
         # convert threepid identifiers to user IDs
         if identifier["type"] == "m.id.thirdparty":
-            if not 'medium' in identifier or not 'address' in identifier:
+            if 'medium' not in identifier or 'address' not in identifier:
                 raise SynapseError(400, "Invalid thirdparty identifier")
 
             address = identifier['address']
@@ -198,7 +198,7 @@ class LoginRestServlet(ClientV1RestServlet):
                 # (See add_threepid in synapse/handlers/auth.py)
                 address = address.lower()
             user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
-                    identifier['medium'], address
+                identifier['medium'], address
             )
             if not user_id:
                 raise LoginError(403, "", errcode=Codes.FORBIDDEN)
diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py
index cf80f5ca28..06bb3617ec 100644
--- a/synapse/rest/client/v2_alpha/account.py
+++ b/synapse/rest/client/v2_alpha/account.py
@@ -93,7 +93,7 @@ class MsisdnPasswordRequestTokenRestServlet(RestServlet):
         except phonenumbers.NumberParseException:
             raise SynapseError(400, "Unable to parse phone number")
         msisdn = phonenumbers.format_number(
-                phoneNumber, phonenumbers.PhoneNumberFormat.E164
+            phoneNumber, phonenumbers.PhoneNumberFormat.E164
         )[1:]
 
         existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
@@ -279,7 +279,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
         except phonenumbers.NumberParseException:
             raise SynapseError(400, "Unable to parse phone number")
         msisdn = phonenumbers.format_number(
-                phoneNumber, phonenumbers.PhoneNumberFormat.E164
+            phoneNumber, phonenumbers.PhoneNumberFormat.E164
         )[1:]
 
         existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index 768e753083..ad3c70814d 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -116,7 +116,7 @@ class MsisdnRegisterRequestTokenRestServlet(RestServlet):
         except phonenumbers.NumberParseException:
             raise SynapseError(400, "Unable to parse phone number")
         msisdn = phonenumbers.format_number(
-                phoneNumber, phonenumbers.PhoneNumberFormat.E164
+            phoneNumber, phonenumbers.PhoneNumberFormat.E164
         )[1:]
 
         existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(