From 8cd1a42fb9121dd6157354d515973268fd3632fc Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 2 Jun 2022 11:50:10 +0200 Subject: [PATCH] *: fix linting Signed-off-by: Jens Langhammer --- authentik/flows/management/commands/benchmark.py | 6 +++--- authentik/flows/transfer/importer.py | 1 + authentik/providers/saml/models.py | 2 +- authentik/stages/consent/models.py | 4 +--- authentik/stages/prompt/models.py | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/authentik/flows/management/commands/benchmark.py b/authentik/flows/management/commands/benchmark.py index 01271024c..aeb14b57d 100644 --- a/authentik/flows/management/commands/benchmark.py +++ b/authentik/flows/management/commands/benchmark.py @@ -94,9 +94,9 @@ class Command(BaseCommand): # pragma: no cover def output_overview(self, values): """Output results human readable""" - total_max: int = max([max(inner) for inner in values]) - total_min: int = min([min(inner) for inner in values]) - total_avg = sum([sum(inner) for inner in values]) / sum([len(inner) for inner in values]) + total_max: int = max(max(inner) for inner in values) + total_min: int = min(min(inner) for inner in values) + total_avg = sum(sum(inner) for inner in values) / sum(len(inner) for inner in values) print(f"Version: {__version__}") print(f"Processes: {len(values)}") diff --git a/authentik/flows/transfer/importer.py b/authentik/flows/transfer/importer.py index dec5aae24..c4bcd8524 100644 --- a/authentik/flows/transfer/importer.py +++ b/authentik/flows/transfer/importer.py @@ -28,6 +28,7 @@ ALLOWED_MODELS = (Flow, FlowStageBinding, Stage, Policy, PolicyBinding, Prompt) def transaction_rollback(): """Enters an atomic transaction and always triggers a rollback at the end of the block.""" atomic = transaction.atomic() + # pylint: disable=unnecessary-dunder-call atomic.__enter__() yield atomic.__exit__(IntegrityError, None, None) diff --git a/authentik/providers/saml/models.py b/authentik/providers/saml/models.py index 18f274a34..660bc9afe 100644 --- a/authentik/providers/saml/models.py +++ b/authentik/providers/saml/models.py @@ -52,7 +52,7 @@ class SAMLProvider(Provider): default=SAMLBindings.REDIRECT, verbose_name=_("Service Provider Binding"), help_text=_( - ("This determines how authentik sends the " "response back to the Service Provider.") + ("This determines how authentik sends the response back to the Service Provider.") ), ) diff --git a/authentik/stages/consent/models.py b/authentik/stages/consent/models.py index 3e13cec8f..45c251cb2 100644 --- a/authentik/stages/consent/models.py +++ b/authentik/stages/consent/models.py @@ -26,9 +26,7 @@ class ConsentStage(Stage): validators=[timedelta_string_validator], default="weeks=4", verbose_name="Consent expires in", - help_text=_( - ("Offset after which consent expires. " "(Format: hours=1;minutes=2;seconds=3).") - ), + help_text=_(("Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3).")), ) @property diff --git a/authentik/stages/prompt/models.py b/authentik/stages/prompt/models.py index bf196381b..e657ea1a7 100644 --- a/authentik/stages/prompt/models.py +++ b/authentik/stages/prompt/models.py @@ -43,7 +43,7 @@ class FieldTypes(models.TextChoices): # Same as text, but has autocomplete for password managers USERNAME = ( "username", - _(("Username: Same as Text input, but checks for " "and prevents duplicate usernames.")), + _(("Username: Same as Text input, but checks for and prevents duplicate usernames.")), ) EMAIL = "email", _("Email: Text field with Email type.") PASSWORD = (