diff options
author | Matthew Hodgson <matthew@matrix.org> | 2016-02-10 16:27:15 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2016-02-10 16:27:15 +0000 |
commit | 76346870571ce885d07b180cf88c11a33a051cf8 (patch) | |
tree | 832664ad8351517a43bd91230eeacf257b2c0bec /synapse/rest/client/v1/register.py | |
parent | try to bump syweb to 0.6.8 (diff) | |
parent | Merge branch 'release-v0.13.0' of github.com:matrix-org/synapse (diff) | |
download | synapse-76346870571ce885d07b180cf88c11a33a051cf8.tar.xz |
Merge branch 'master' of git+ssh://github.com/matrix-org/synapse
Diffstat (limited to 'synapse/rest/client/v1/register.py')
-rw-r--r-- | synapse/rest/client/v1/register.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py index 4b02311e05..6d6d03c34c 100644 --- a/synapse/rest/client/v1/register.py +++ b/synapse/rest/client/v1/register.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2014, 2015 OpenMarket Ltd +# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,7 +38,8 @@ logger = logging.getLogger(__name__) if hasattr(hmac, "compare_digest"): compare_digest = hmac.compare_digest else: - compare_digest = lambda a, b: a == b + def compare_digest(a, b): + return a == b class RegisterRestServlet(ClientV1RestServlet): @@ -58,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: @@ -112,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 ) |