summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-10-17 16:56:22 +0100
committerRichard van der Hoff <richard@matrix.org>2018-10-17 16:56:22 +0100
commitc8f2c199910b70a5d94acf5597a4f3ba94cd3969 (patch)
tree1c1620912f5bdec15bd4f1cc43fe47a66a231b72
parentShip the email templates as package_data (diff)
downloadsynapse-c8f2c199910b70a5d94acf5597a4f3ba94cd3969.tar.xz
Put the warning blob at the top of the file
Diffstat (limited to '')
-rw-r--r--synapse/config/emailconfig.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py
index 862f92c6ae..e2582cfecc 100644
--- a/synapse/config/emailconfig.py
+++ b/synapse/config/emailconfig.py
@@ -26,6 +26,12 @@ from ._base import Config
 
 logger = logging.getLogger(__name__)
 
+TEMPLATE_DIR_WARNING = """\
+WARNING: The email notifier is configured to look for templates in '%(template_dir)s',
+but no templates could be found there. We will fall back to using the example templates;
+to get rid of this warning, leave 'email.template_dir' unset.
+"""
+
 
 class EmailConfig(Config):
     def read_config(self, config):
@@ -81,12 +87,9 @@ class EmailConfig(Config):
                     os.path.join(self.email_template_dir, self.email_notif_template_text)
                 )
             ):
-                t = """\
-WARNING: The email notifier is configured to look for templates in '%s', but no templates
-could be found there. We will fall back to using the example templates; to get rid of this
-warning, leave 'email.template_dir' unset.
-""" % (self.email_template_dir,)
-
+                t = TEMPLATE_DIR_WARNING % {
+                    "template_dir": self.email_template_dir,
+                }
                 print(textwrap.fill(t, width=80) + "\n", file=sys.stderr)
                 self.email_template_dir = None