From 537c7e1137684c97676bbb74d59cd93c5bf1aad1 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Tue, 23 Sep 2014 15:18:59 +0100 Subject: [PATCH] Config values are almost never 'None', but they might be empty string. Detect their presence by truth --- synapse/rest/register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/rest/register.py b/synapse/rest/register.py index 3b07a127a..66cef26ad 100644 --- a/synapse/rest/register.py +++ b/synapse/rest/register.py @@ -153,7 +153,7 @@ class RegisterRestServlet(RestServlet): @defer.inlineCallbacks def _check_recaptcha(self, request, register_json): if "captcha_bypass_secret" in register_json: - if (self.hs.config.captcha_bypass_secret is not None and + if (self.hs.config.captcha_bypass_secret and register_json["captcha_bypass_secret"] == self.hs.config.captcha_bypass_secret): defer.returnValue(None)