mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 21:23:51 +01:00
Fix pep8
This commit is contained in:
parent
00466e2feb
commit
402a7bf63d
4 changed files with 7 additions and 7 deletions
|
@ -344,7 +344,7 @@ class AuthHandler(BaseHandler):
|
||||||
medium, threepid['medium'],
|
medium, threepid['medium'],
|
||||||
),
|
),
|
||||||
errcode=Codes.UNAUTHORIZED
|
errcode=Codes.UNAUTHORIZED
|
||||||
)
|
)
|
||||||
|
|
||||||
threepid['threepid_creds'] = authdict['threepid_creds']
|
threepid['threepid_creds'] = authdict['threepid_creds']
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ def login_id_thirdparty_from_phone(identifier):
|
||||||
except phonenumbers.NumberParseException:
|
except phonenumbers.NumberParseException:
|
||||||
raise SynapseError(400, "Unable to parse phone number")
|
raise SynapseError(400, "Unable to parse phone number")
|
||||||
msisdn = phonenumbers.format_number(
|
msisdn = phonenumbers.format_number(
|
||||||
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
||||||
)[1:]
|
)[1:]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -188,7 +188,7 @@ class LoginRestServlet(ClientV1RestServlet):
|
||||||
|
|
||||||
# convert threepid identifiers to user IDs
|
# convert threepid identifiers to user IDs
|
||||||
if identifier["type"] == "m.id.thirdparty":
|
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")
|
raise SynapseError(400, "Invalid thirdparty identifier")
|
||||||
|
|
||||||
address = identifier['address']
|
address = identifier['address']
|
||||||
|
@ -198,7 +198,7 @@ class LoginRestServlet(ClientV1RestServlet):
|
||||||
# (See add_threepid in synapse/handlers/auth.py)
|
# (See add_threepid in synapse/handlers/auth.py)
|
||||||
address = address.lower()
|
address = address.lower()
|
||||||
user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
|
user_id = yield self.hs.get_datastore().get_user_id_by_threepid(
|
||||||
identifier['medium'], address
|
identifier['medium'], address
|
||||||
)
|
)
|
||||||
if not user_id:
|
if not user_id:
|
||||||
raise LoginError(403, "", errcode=Codes.FORBIDDEN)
|
raise LoginError(403, "", errcode=Codes.FORBIDDEN)
|
||||||
|
|
|
@ -93,7 +93,7 @@ class MsisdnPasswordRequestTokenRestServlet(RestServlet):
|
||||||
except phonenumbers.NumberParseException:
|
except phonenumbers.NumberParseException:
|
||||||
raise SynapseError(400, "Unable to parse phone number")
|
raise SynapseError(400, "Unable to parse phone number")
|
||||||
msisdn = phonenumbers.format_number(
|
msisdn = phonenumbers.format_number(
|
||||||
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
||||||
)[1:]
|
)[1:]
|
||||||
|
|
||||||
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
|
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
|
||||||
|
@ -279,7 +279,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
|
||||||
except phonenumbers.NumberParseException:
|
except phonenumbers.NumberParseException:
|
||||||
raise SynapseError(400, "Unable to parse phone number")
|
raise SynapseError(400, "Unable to parse phone number")
|
||||||
msisdn = phonenumbers.format_number(
|
msisdn = phonenumbers.format_number(
|
||||||
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
||||||
)[1:]
|
)[1:]
|
||||||
|
|
||||||
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
|
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
|
||||||
|
|
|
@ -116,7 +116,7 @@ class MsisdnRegisterRequestTokenRestServlet(RestServlet):
|
||||||
except phonenumbers.NumberParseException:
|
except phonenumbers.NumberParseException:
|
||||||
raise SynapseError(400, "Unable to parse phone number")
|
raise SynapseError(400, "Unable to parse phone number")
|
||||||
msisdn = phonenumbers.format_number(
|
msisdn = phonenumbers.format_number(
|
||||||
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
phoneNumber, phonenumbers.PhoneNumberFormat.E164
|
||||||
)[1:]
|
)[1:]
|
||||||
|
|
||||||
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
|
existingUid = yield self.hs.get_datastore().get_user_id_by_threepid(
|
||||||
|
|
Loading…
Reference in a new issue