From d42933c07b4028ba6fe5d367e840398a180044bf Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 20 Sep 2021 16:36:13 +0200 Subject: [PATCH 29/59] misc: fix consider-using-in pylint error (#56982) --- src/authentic2/csv_import.py | 2 +- src/authentic2/saml/common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authentic2/csv_import.py b/src/authentic2/csv_import.py index eb4f6034..48467d43 100644 --- a/src/authentic2/csv_import.py +++ b/src/authentic2/csv_import.py @@ -298,7 +298,7 @@ class CsvRow: def __getitem__(self, header): for cell in self.cells: - if cell.header == header or cell.header.name == header: + if header in (cell.header, cell.header.name): return cell raise KeyError(header.name) diff --git a/src/authentic2/saml/common.py b/src/authentic2/saml/common.py index d7457753..60b659cc 100644 --- a/src/authentic2/saml/common.py +++ b/src/authentic2/saml/common.py @@ -378,7 +378,7 @@ def load_provider(request, entity_id, server=None, sp_or_idp='sp', autoload=Fals liberty_provider = LibertyProvider.objects.get(entity_id=entity_id) except LibertyProvider.DoesNotExist: autoload = getattr(settings, 'SAML_METADATA_AUTOLOAD', 'none') - if autoload and (autoload == 'sp' or autoload == 'both'): + if autoload in ('sp', 'both'): liberty_provider = retrieve_metadata_and_create(request, entity_id, sp_or_idp) if not liberty_provider: return False -- 2.30.2