fix: fix 'possibly-used-before-assignment' for pylint
This commit is contained in:
parent
da149e932d
commit
a47dfbad01
2 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue