summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-23 11:37:47 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-23 11:37:47 +0000
commit7ed8a68815355378bf5f11ff7e9bc11f6f047947 (patch)
treeb63277048cd2bacb059b9dfb4f5e6a4f56bac98b
parentAdd more logging around message retention policies support (#6717) (diff)
parentFix empty account_validity config block (#6747) (diff)
downloadsynapse-7ed8a68815355378bf5f11ff7e9bc11f6f047947.tar.xz
Fix empty account_validity config block (#6747)
* commit 'e9e066055':
  Update changelog.d/6747.bugfix
  Revert "Newsfile"
  Newsfile
  Add changelog
  Fix empty account_validity config block
-rw-r--r--changelog.d/6747.bugfix1
-rw-r--r--synapse/config/registration.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.d/6747.bugfix b/changelog.d/6747.bugfix
new file mode 100644

index 0000000000..c98107e741 --- /dev/null +++ b/changelog.d/6747.bugfix
@@ -0,0 +1 @@ +Fix bug when setting `account_validity` to an empty block in the config. Thanks to @Sorunome for reporting. diff --git a/synapse/config/registration.py b/synapse/config/registration.py
index cbb5155a50..7dba213d74 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py
@@ -29,6 +29,7 @@ class AccountValidityConfig(Config): def __init__(self, config, synapse_config): if config is None: return + super(AccountValidityConfig, self).__init__() self.enabled = config.get("enabled", False) self.renew_by_email_enabled = "renew_at" in config @@ -93,7 +94,7 @@ class RegistrationConfig(Config): ) self.account_validity = AccountValidityConfig( - config.get("account_validity", {}), config + config.get("account_validity") or {}, config ) self.registrations_require_3pid = config.get("registrations_require_3pid", [])