Skip to content

Commit

Permalink
Fix buggy condition in account validity handler (matrix-org#7074)
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier authored and phil-flex committed Mar 27, 2020
1 parent 2894641 commit e979b3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7074.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug causing account validity renewal emails to be sent even if the feature is turned off in some cases.
6 changes: 5 additions & 1 deletion synapse/handlers/account_validity.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def __init__(self, hs):

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
Expand Down

0 comments on commit e979b3d

Please sign in to comment.