trivial: fix unnecessary-lambda pylint warning (#52732)

This commit is contained in:
Frédéric Péters 2021-04-03 10:04:34 +02:00
parent 528e0917e0
commit d67c024f15
5 changed files with 5 additions and 6 deletions

View File

@ -55,7 +55,6 @@ disable=
too-many-statements,
undefined-loop-variable,
unnecessary-comprehension,
unnecessary-lambda,
unsubscriptable-object,
unsupported-membership-test,
unused-argument

View File

@ -1699,7 +1699,7 @@ def test_backoffice_multi_actions_oldest_form(pub):
assert 'Executing task "Mark as duplicates" on forms' in resp.text
assert '>completed<' in resp.text
oldest_formdata = None
for i, id in enumerate(sorted(ids, key=lambda x: int(x))):
for i, id in enumerate(sorted(ids, key=int)):
if i == 0:
oldest_formdata = formdef.data_class().get(id)
assert formdef.data_class().get(id).status == 'wf-accepted'
@ -1743,7 +1743,7 @@ def test_backoffice_multi_actions_using_session_user(pub):
resp = resp.follow()
assert 'Executing task &quot;Show user&quot; on forms' in resp.text
assert '>completed<' in resp.text
for id in sorted(ids, key=lambda x: int(x)):
for id in sorted(ids, key=int):
content = formdef.data_class().get(id).evolution[-1].parts[0].content
assert 'session_user=admin' in content

View File

@ -1265,7 +1265,7 @@ def test_block_with_dynamic_item_field(mock_urlopen, pub, blocks_feature):
payload = [{'id': '2', 'text': 'bar'}]
return io.StringIO(json.dumps({'data': payload}))
mock_urlopen.side_effect = lambda url: data_source(url)
mock_urlopen.side_effect = data_source
FormDef.wipe()
BlockDef.wipe()

View File

@ -216,7 +216,7 @@ class FormDefUI:
item_ids_dict = {x: True for x in item_ids}
item_ids = [x for x in ordered_ids if x in item_ids_dict]
else:
item_ids.sort(key=lambda x: int(x))
item_ids.sort(key=int)
item_ids.reverse()
total_count = len(item_ids)

View File

@ -2642,7 +2642,7 @@ $(function() {
pwd1 = None
PASSWORD_FORMATS = {
'cleartext': lambda x: force_str(x),
'cleartext': force_str,
'md5': lambda x: force_str(hashlib.md5(force_bytes(x)).hexdigest()),
'sha1': lambda x: force_str(hashlib.sha1(force_bytes(x)).hexdigest()),
}