misc: pylint fix simplifiable-if-statement (#52222)
This commit is contained in:
parent
e8ec57ac99
commit
46be3ca3ce
|
@ -300,10 +300,7 @@ class FieldsDirectory(Directory):
|
|||
for field in self.objectdef.fields:
|
||||
if field.type == 'page':
|
||||
current_page_no += 1
|
||||
if str(field.id) == self.page_id:
|
||||
on_page = True
|
||||
else:
|
||||
on_page = False
|
||||
on_page = bool(str(field.id) == self.page_id)
|
||||
|
||||
hidden = ''
|
||||
if self.page_id and (not on_page or field.type == 'page'):
|
||||
|
|
|
@ -1520,10 +1520,7 @@ class CheckboxesWidget(CompositeWidget):
|
|||
# don't mark individual checkboxes as required
|
||||
element_kwargs.pop('required', None)
|
||||
|
||||
if value and key in value:
|
||||
checked = True
|
||||
else:
|
||||
checked = False
|
||||
checked = bool(value and key in value)
|
||||
self.add(CheckboxWidget, name, title=title, value=checked, **element_kwargs)
|
||||
self.element_names[name] = key
|
||||
|
||||
|
|
|
@ -91,10 +91,7 @@ def check_key_pair_consistency(publickey=None, privatekey=None):
|
|||
if rc2 != 0:
|
||||
rc2, modulus2 = _call_openssl(['dsa', '-in', privatekey_fn, '-noout', '-modulus'])
|
||||
|
||||
if rc1 == 0 and rc2 == 0 and modulus1 == modulus2:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return bool(rc1 == 0 and rc2 == 0 and modulus1 == modulus2)
|
||||
finally:
|
||||
os.unlink(privatekey_fn)
|
||||
os.unlink(publickey_fn)
|
||||
|
|
Loading…
Reference in New Issue