From 1f07bdd5f350ad9702c1c6178d09a1b77ccb89ea Mon Sep 17 00:00:00 2001 From: "H. Shay" Date: Mon, 15 Nov 2021 10:40:57 -0800 Subject: slightly change behavior to only check for deprecated flag if set to 'true' --- synapse/config/emailconfig.py | 2 +- tests/config/test_load.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py index 5e787c3aef..510b647c63 100644 --- a/synapse/config/emailconfig.py +++ b/synapse/config/emailconfig.py @@ -138,7 +138,7 @@ class EmailConfig(Config): else ThreepidBehaviour.LOCAL ) - if "trust_identity_server_for_password_resets" in config: + if config.get("trust_identity_server_for_password_resets"): raise ConfigError( 'The config option "trust_identity_server_for_password_resets" ' 'has been replaced by "account_threepid_delegate". ' diff --git a/tests/config/test_load.py b/tests/config/test_load.py index 10a7f145d2..d8668d56b2 100644 --- a/tests/config/test_load.py +++ b/tests/config/test_load.py @@ -99,11 +99,7 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase): self.generate_config() # Needed to ensure that actual key/value pair added below don't end up on a line with a comment self.add_lines_to_config([" "]) - # Check that presence of "trust_identity_server_for_password" throws config error whether - # true or false + # Check that presence of "trust_identity_server_for_password" throws config error self.add_lines_to_config(["trust_identity_server_for_password_resets: true"]) with self.assertRaises(ConfigError): HomeServerConfig.load_config("", ["-c", self.config_file]) - self.add_lines_to_config(["trust_identity_server_for_password_resets: false"]) - with self.assertRaises(ConfigError): - HomeServerConfig.load_config("", ["-c", self.config_file]) -- cgit 1.4.1