summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2020-03-16 12:16:30 +0000
committerGitHub <noreply@github.com>2020-03-16 12:16:30 +0000
commitbeb19cf61a79e4bfb06b4b1fffd51388b64698ca (patch)
treea1c7e5305847bf98d0d5f9da8e98eeeaba06686e
parentMerge pull request #7067 from matrix-org/babolivier/saml_error_moar (diff)
downloadsynapse-beb19cf61a79e4bfb06b4b1fffd51388b64698ca.tar.xz
Fix buggy condition in account validity handler (#7074)
-rw-r--r--changelog.d/7074.bugfix1
-rw-r--r--synapse/handlers/account_validity.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/changelog.d/7074.bugfix b/changelog.d/7074.bugfix
new file mode 100644
index 0000000000..38d7455971
--- /dev/null
+++ b/changelog.d/7074.bugfix
@@ -0,0 +1 @@
+Fix a bug causing account validity renewal emails to be sent even if the feature is turned off in some cases.
diff --git a/synapse/handlers/account_validity.py b/synapse/handlers/account_validity.py
index 829f52eca1..590135d19c 100644
--- a/synapse/handlers/account_validity.py
+++ b/synapse/handlers/account_validity.py
@@ -44,7 +44,11 @@ class AccountValidityHandler(object):
 
         self._account_validity = self.hs.config.account_validity
 
-        if self._account_validity.renew_by_email_enabled and load_jinja2_templates:
+        if (
+            self._account_validity.enabled
+            and self._account_validity.renew_by_email_enabled
+            and load_jinja2_templates
+        ):
             # Don't do email-specific configuration if renewal by email is disabled.
             try:
                 app_name = self.hs.config.email_app_name