Email: fix handling templates_path default value

This commit is contained in:
Benjamin Renard 2023-03-13 19:13:52 +01:00
parent 93b06d6127
commit d75a61b4e8
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC
2 changed files with 3 additions and 3 deletions

View file

@ -143,6 +143,7 @@ class EmailClient(
section.add_option(
StringOption,
"templates_path",
default=self._defaults["templates_path"],
comment="Path to templates directory",
)

View file

@ -18,12 +18,11 @@ def main(argv=None): # pylint: disable=too-many-locals,too-many-statements
config = Config(__doc__, __name__.replace(".", "_"))
email_client = EmailClient(config=config)
email_client.configure()
config.set_default(
"email",
email_client.set_default(
"templates_path",
os.path.join(os.path.dirname(os.path.realpath(__file__)), "email_templates"),
)
email_client.configure()
# Options parser
parser = config.get_arguments_parser(description=__doc__)