mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Put the warning blob at the top of the file
This commit is contained in:
parent
1519572961
commit
c8f2c19991
@ -26,6 +26,12 @@ from ._base import Config
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
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):
|
class EmailConfig(Config):
|
||||||
def read_config(self, 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)
|
os.path.join(self.email_template_dir, self.email_notif_template_text)
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
t = """\
|
t = TEMPLATE_DIR_WARNING % {
|
||||||
WARNING: The email notifier is configured to look for templates in '%s', but no templates
|
"template_dir": self.email_template_dir,
|
||||||
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,)
|
|
||||||
|
|
||||||
print(textwrap.fill(t, width=80) + "\n", file=sys.stderr)
|
print(textwrap.fill(t, width=80) + "\n", file=sys.stderr)
|
||||||
self.email_template_dir = None
|
self.email_template_dir = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user