mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
pep8
This commit is contained in:
parent
0e2d70e101
commit
739d3500fe
@ -33,7 +33,9 @@ class RegistrationConfig(Config):
|
|||||||
|
|
||||||
self.registrations_require_3pid = config.get("registrations_require_3pid", [])
|
self.registrations_require_3pid = config.get("registrations_require_3pid", [])
|
||||||
self.allowed_local_3pids = config.get("allowed_local_3pids", [])
|
self.allowed_local_3pids = config.get("allowed_local_3pids", [])
|
||||||
self.check_is_for_allowed_local_3pids = config.get("check_is_for_allowed_local_3pids", False)
|
self.check_is_for_allowed_local_3pids = config.get(
|
||||||
|
"check_is_for_allowed_local_3pids", False
|
||||||
|
)
|
||||||
self.registration_shared_secret = config.get("registration_shared_secret")
|
self.registration_shared_secret = config.get("registration_shared_secret")
|
||||||
|
|
||||||
self.bcrypt_rounds = config.get("bcrypt_rounds", 12)
|
self.bcrypt_rounds = config.get("bcrypt_rounds", 12)
|
||||||
|
@ -308,7 +308,9 @@ class RegistrationHandler(BaseHandler):
|
|||||||
logger.info("got threepid with medium '%s' and address '%s'",
|
logger.info("got threepid with medium '%s' and address '%s'",
|
||||||
threepid['medium'], threepid['address'])
|
threepid['medium'], threepid['address'])
|
||||||
|
|
||||||
if not (yield check_3pid_allowed(self.hs, threepid['medium'], threepid['address'])):
|
if not (
|
||||||
|
yield check_3pid_allowed(self.hs, threepid['medium'], threepid['address'])
|
||||||
|
):
|
||||||
raise RegistrationError(
|
raise RegistrationError(
|
||||||
403, "Third party identifier is not allowed"
|
403, "Third party identifier is not allowed"
|
||||||
)
|
)
|
||||||
|
@ -40,7 +40,7 @@ def check_3pid_allowed(hs, medium, address):
|
|||||||
hs.config.check_is_for_allowed_local_3pids,
|
hs.config.check_is_for_allowed_local_3pids,
|
||||||
"/_matrix/identity/api/v1/discover_urls"
|
"/_matrix/identity/api/v1/discover_urls"
|
||||||
),
|
),
|
||||||
{'medium': medium, 'address': address }
|
{'medium': medium, 'address': address}
|
||||||
)
|
)
|
||||||
defer.returnValue(data['hs_url'] + "/" == hs.config.public_baseurl)
|
defer.returnValue(data['hs_url'] + "/" == hs.config.public_baseurl)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user