3
0
Fork 0

fix: fix 'possibly-used-before-assignment' for pylint

This commit is contained in:
Lance Edgar 2025-08-30 20:25:05 -05:00
parent da149e932d
commit a47dfbad01
2 changed files with 3 additions and 3 deletions

View file

@ -22,6 +22,7 @@ enable=anomalous-backslash-in-string,
missing-module-docstring,
no-else-return,
no-self-argument,
possibly-used-before-assignment,
redefined-argument-from-local,
too-few-public-methods,
trailing-whitespace,

View file

@ -583,13 +583,12 @@ class EmailHandler(GenericHandler):
def get_auto_body_template(self, key, mode): # pylint: disable=empty-docstring
""" """
mode = mode.lower()
if mode not in ('txt', 'html'):
raise ValueError("requested mode not supported")
if mode == 'txt':
templates = self.txt_templates
elif mode == 'html':
templates = self.html_templates
else:
raise ValueError("requested mode not supported")
try:
return templates.get_template(f'{key}.{mode}.mako')