diff options
author | Daniel Wagner-Hall <dawagner@gmail.com> | 2016-02-03 14:55:54 +0000 |
---|---|---|
committer | Daniel Wagner-Hall <dawagner@gmail.com> | 2016-02-03 14:55:54 +0000 |
commit | 66bb255fcd0173ed50a3b1067ac097353512b6a7 (patch) | |
tree | d6e60017335d1ab34f8e8d5c2fd6e8e4ad988096 /synapse | |
parent | Merge pull request #552 from matrix-org/erikj/public_room_fix (diff) | |
parent | Rename config field to reflect yaml name (diff) | |
download | synapse-66bb255fcd0173ed50a3b1067ac097353512b6a7.tar.xz |
Merge pull request #556 from matrix-org/daniel/config
Rename config field to reflect yaml name
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/config/registration.py | 6 | ||||
-rw-r--r-- | synapse/rest/client/v1/register.py | 4 | ||||
-rw-r--r-- | synapse/rest/client/v2_alpha/register.py | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/synapse/config/registration.py b/synapse/config/registration.py index 76d2d2d640..90ea19bd4b 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py @@ -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)) ) diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py index 2bfd4d96bf..6d6d03c34c 100644 --- a/synapse/rest/client/v1/register.py +++ b/synapse/rest/client/v1/register.py @@ -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 ) diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index 56a5bbec30..ec5c21fa1f 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -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) |