misc: pylint fix consider-using-in (#52222)

This commit is contained in:
Lauréline Guérin 2021-03-22 11:02:15 +01:00
parent f2a3f4c300
commit 17d73057b7
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 2 additions and 2 deletions

View File

@ -1934,7 +1934,7 @@ class FormPage(Directory):
field_options = filter_field.get_options()
if field_options and type(field_options[0]) in (list, tuple):
for option in field_options:
if option[0] == filter_field_value or option[-1] == filter_field_value:
if filter_field_value in (option[0], option[-1]):
filter_field_value = option[1]
break
criterias[-1]._label = '%s: %s' % (filter_field.label, filter_field_value)

View File

@ -1653,7 +1653,7 @@ class CaptchaWidget(CompositeWidget):
self.add(HtmlWidget, 'token', title=hidden_input % (self.name, token['token']))
# create question, and fill token['answer']
if mode == 'arithmetic' or mode == 'arithmetic-simple':
if mode in ('arithmetic', 'arithmetic-simple'):
a, b = random.randint(2, 9), random.randint(2, 9)
while b == a:
# don't get twice the same number