trivial: fix consider-using-ternary pylint warning (#52732)

This commit is contained in:
Frédéric Péters 2021-04-02 22:34:27 +02:00
parent 531d15fd76
commit fc780d27a7
2 changed files with 1 additions and 2 deletions

View File

@ -14,7 +14,6 @@ disable=
broad-except,
consider-using-dict-comprehension,
consider-using-set-comprehension,
consider-using-ternary,
cyclic-import,
deprecated-module,
disallowed-name,

View File

@ -209,7 +209,7 @@ class SubmitWidget(quixote.form.widget.SubmitWidget):
def render_content(self):
if self.name in ('cancel', 'previous', 'save-draft'):
self.attrs['formnovalidate'] = 'formnovalidate'
value = self.label and htmlescape(self.label) or None
value = htmlescape(self.label) if self.label else None
return (
htmltag('button', name=self.name, value=value, **self.attrs) + self.label + htmltext('</button>')
)