From eae9295184054880310eb9b4199f9fd9648d1888 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Wed, 20 Dec 2023 11:20:14 +0100 Subject: [PATCH] lint Signed-off-by: Marc 'risson' Schmitt --- authentik/brands/middleware.py | 1 - authentik/brands/tests.py | 3 --- authentik/root/storages.py | 6 ++++++ authentik/tenants/api.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/authentik/brands/middleware.py b/authentik/brands/middleware.py index 627711233..744b700c9 100644 --- a/authentik/brands/middleware.py +++ b/authentik/brands/middleware.py @@ -4,7 +4,6 @@ from typing import Callable from django.http.request import HttpRequest from django.http.response import HttpResponse from django.utils.translation import activate -from sentry_sdk.api import set_tag from authentik.brands.utils import get_brand_for_request diff --git a/authentik/brands/tests.py b/authentik/brands/tests.py index 4b242b068..998db7977 100644 --- a/authentik/brands/tests.py +++ b/authentik/brands/tests.py @@ -1,13 +1,10 @@ """Test brands""" -from django.test.client import RequestFactory from django.urls import reverse from rest_framework.test import APITestCase from authentik.brands.api import Themes from authentik.brands.models import Brand from authentik.core.tests.utils import create_test_admin_user, create_test_brand -from authentik.events.models import Event, EventAction -from authentik.lib.utils.time import timedelta_from_string class TestBrands(APITestCase): diff --git a/authentik/root/storages.py b/authentik/root/storages.py index 6fd87e336..347200f96 100644 --- a/authentik/root/storages.py +++ b/authentik/root/storages.py @@ -12,16 +12,21 @@ from authentik.lib.config import CONFIG class FileStorage(FileSystemStorage): + """File storage backend""" + + # pylint: disable=invalid-overridden-method @property def base_location(self): return os.path.join( self._value_or_setting(self._location, settings.MEDIA_ROOT), connection.schema_name ) + # pylint: disable=invalid-overridden-method @property def location(self): return os.path.abspath(self.base_location) + # pylint: disable=invalid-overridden-method @property def base_url(self): if self._base_url is not None and not self._base_url.endswith("/"): @@ -71,6 +76,7 @@ class S3Storage(BaseS3Storage): def _normalize_name(self, name): try: + # pylint: disable=no-member return safe_join(self.location, connection.schema_name, name) except ValueError: raise SuspiciousOperation("Attempted access to '%s' denied." % name) diff --git a/authentik/tenants/api.py b/authentik/tenants/api.py index 006153f4d..1f81e7f2e 100644 --- a/authentik/tenants/api.py +++ b/authentik/tenants/api.py @@ -6,7 +6,7 @@ from rest_framework import permissions from rest_framework.authentication import get_authorization_header from rest_framework.filters import OrderingFilter, SearchFilter from rest_framework.generics import RetrieveUpdateAPIView -from rest_framework.permissions import SAFE_METHODS, IsAdminUser +from rest_framework.permissions import SAFE_METHODS from rest_framework.request import Request from rest_framework.serializers import ModelSerializer from rest_framework.views import View