mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-18 17:44:36 -04:00
Rename config field to reflect yaml name
This commit is contained in:
parent
5f280837a6
commit
5054806ec1
6 changed files with 10 additions and 10 deletions
|
@ -23,11 +23,11 @@ from distutils.util import strtobool
|
|||
class RegistrationConfig(Config):
|
||||
|
||||
def read_config(self, config):
|
||||
self.disable_registration = not bool(
|
||||
self.enable_registration = bool(
|
||||
strtobool(str(config["enable_registration"]))
|
||||
)
|
||||
if "disable_registration" in config:
|
||||
self.disable_registration = bool(
|
||||
self.enable_registration = not bool(
|
||||
strtobool(str(config["disable_registration"]))
|
||||
)
|
||||
|
||||
|
@ -78,6 +78,6 @@ class RegistrationConfig(Config):
|
|||
|
||||
def read_arguments(self, args):
|
||||
if args.enable_registration is not None:
|
||||
self.disable_registration = not bool(
|
||||
self.enable_registration = bool(
|
||||
strtobool(str(args.enable_registration))
|
||||
)
|
||||
|
|
|
@ -59,7 +59,7 @@ class RegisterRestServlet(ClientV1RestServlet):
|
|||
# }
|
||||
# TODO: persistent storage
|
||||
self.sessions = {}
|
||||
self.disable_registration = hs.config.disable_registration
|
||||
self.enable_registration = hs.config.enable_registration
|
||||
|
||||
def on_GET(self, request):
|
||||
if self.hs.config.enable_registration_captcha:
|
||||
|
@ -113,7 +113,7 @@ class RegisterRestServlet(ClientV1RestServlet):
|
|||
is_using_shared_secret = login_type == LoginType.SHARED_SECRET
|
||||
|
||||
can_register = (
|
||||
not self.disable_registration
|
||||
self.enable_registration
|
||||
or is_application_server
|
||||
or is_using_shared_secret
|
||||
)
|
||||
|
|
|
@ -117,7 +117,7 @@ class RegisterRestServlet(RestServlet):
|
|||
return
|
||||
|
||||
# == Normal User Registration == (everyone else)
|
||||
if self.hs.config.disable_registration:
|
||||
if not self.hs.config.enable_registration:
|
||||
raise SynapseError(403, "Registration has been disabled")
|
||||
|
||||
guest_access_token = body.get("guest_access_token", None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue