From e2804b9755b9665de021853111dbffae98a8bba5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 27 May 2020 11:26:48 +0200 Subject: [PATCH] root: fix linting errors --- passbook/lib/config.py | 2 +- passbook/providers/saml/models.py | 2 +- passbook/providers/saml/processors/base.py | 1 + passbook/providers/saml/views.py | 4 ++-- passbook/root/settings.py | 8 ++++---- passbook/root/urls.py | 2 +- passbook/sources/oauth/views/core.py | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/passbook/lib/config.py b/passbook/lib/config.py index b09d9a456..a0f473d83 100644 --- a/passbook/lib/config.py +++ b/passbook/lib/config.py @@ -10,7 +10,7 @@ import yaml from django.conf import ImproperlyConfigured from structlog import get_logger -SEARCH_PATHS = ["passbook/lib/default.yml", "/etc/passbook/config.yml", "",] + glob( +SEARCH_PATHS = ["passbook/lib/default.yml", "/etc/passbook/config.yml", ""] + glob( "/etc/passbook/config.d/*.yml", recursive=True ) LOGGER = get_logger() diff --git a/passbook/providers/saml/models.py b/passbook/providers/saml/models.py index 1cae3fc84..4472df8c7 100644 --- a/passbook/providers/saml/models.py +++ b/passbook/providers/saml/models.py @@ -133,7 +133,7 @@ class SAMLProvider(Provider): metadata = DescriptorDownloadView.get_metadata(request, self) return render_to_string( "saml/idp/admin_metadata_modal.html", - {"provider": self, "metadata": metadata,}, + {"provider": self, "metadata": metadata}, ) except Provider.application.RelatedObjectDoesNotExist: return None diff --git a/passbook/providers/saml/processors/base.py b/passbook/providers/saml/processors/base.py index 340249a15..db65e37ff 100644 --- a/passbook/providers/saml/processors/base.py +++ b/passbook/providers/saml/processors/base.py @@ -18,6 +18,7 @@ from passbook.providers.saml.utils.xml_render import get_assertion_xml, get_resp if TYPE_CHECKING: from passbook.providers.saml.models import SAMLProvider + # pylint: disable=too-many-instance-attributes class Processor: """Base SAML 2.0 AuthnRequest to Response Processor. diff --git a/passbook/providers/saml/views.py b/passbook/providers/saml/views.py index bad3ef6ea..555b8e7a9 100644 --- a/passbook/providers/saml/views.py +++ b/passbook/providers/saml/views.py @@ -74,7 +74,7 @@ class AccessRequiredView(AccessMixin, View): return render( request, "login/denied.html", - {"title": _("You don't have access to this application"),}, + {"title": _("You don't have access to this application")}, ) return super().dispatch(request, *args, **kwargs) @@ -175,7 +175,7 @@ class AuthorizeView(AccessRequiredView): return render( request, "saml/idp/login.html", - {"provider": self.provider, "title": "Authorize Application",}, + {"provider": self.provider, "title": "Authorize Application"}, ) except KeyError: diff --git a/passbook/root/settings.py b/passbook/root/settings.py index d1b218d1f..7b770f62d 100644 --- a/passbook/root/settings.py +++ b/passbook/root/settings.py @@ -142,7 +142,7 @@ CACHES = { f"redis://:{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:6379" f"/{CONFIG.y('redis.cache_db')}" ), - "OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",}, + "OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient"}, } } DJANGO_REDIS_IGNORE_EXCEPTIONS = True @@ -202,9 +202,9 @@ AUTH_PASSWORD_VALIDATORS = [ { "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, - {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",}, - {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",}, - {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",}, + {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, + {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, + {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, ] diff --git a/passbook/root/urls.py b/passbook/root/urls.py index 17eee10c0..49e4477e4 100644 --- a/passbook/root/urls.py +++ b/passbook/root/urls.py @@ -50,4 +50,4 @@ urlpatterns += [ if settings.DEBUG: import debug_toolbar - urlpatterns = [path("-/debug/", include(debug_toolbar.urls)),] + urlpatterns + urlpatterns = [path("-/debug/", include(debug_toolbar.urls))] + urlpatterns diff --git a/passbook/sources/oauth/views/core.py b/passbook/sources/oauth/views/core.py index 83526b855..7e3249bc7 100644 --- a/passbook/sources/oauth/views/core.py +++ b/passbook/sources/oauth/views/core.py @@ -284,7 +284,7 @@ class DisconnectView(LoginRequiredMixin, View): "object": self.source, "delete_url": reverse( "passbook_sources_oauth:oauth-client-disconnect", - kwargs={"source_slug": self.source.slug,}, + kwargs={"source_slug": self.source.slug}, ), }, )