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,
|
missing-module-docstring,
|
||||||
no-else-return,
|
no-else-return,
|
||||||
no-self-argument,
|
no-self-argument,
|
||||||
|
possibly-used-before-assignment,
|
||||||
redefined-argument-from-local,
|
redefined-argument-from-local,
|
||||||
too-few-public-methods,
|
too-few-public-methods,
|
||||||
trailing-whitespace,
|
trailing-whitespace,
|
||||||
|
|
|
@ -583,13 +583,12 @@ class EmailHandler(GenericHandler):
|
||||||
def get_auto_body_template(self, key, mode): # pylint: disable=empty-docstring
|
def get_auto_body_template(self, key, mode): # pylint: disable=empty-docstring
|
||||||
""" """
|
""" """
|
||||||
mode = mode.lower()
|
mode = mode.lower()
|
||||||
if mode not in ('txt', 'html'):
|
|
||||||
raise ValueError("requested mode not supported")
|
|
||||||
|
|
||||||
if mode == 'txt':
|
if mode == 'txt':
|
||||||
templates = self.txt_templates
|
templates = self.txt_templates
|
||||||
elif mode == 'html':
|
elif mode == 'html':
|
||||||
templates = self.html_templates
|
templates = self.html_templates
|
||||||
|
else:
|
||||||
|
raise ValueError("requested mode not supported")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return templates.get_template(f'{key}.{mode}.mako')
|
return templates.get_template(f'{key}.{mode}.mako')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue