From 742dc1265619804374d2f460ff6fbd50ed1d4a60 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Tue, 21 Nov 2023 18:31:39 +0100 Subject: [PATCH] lint Signed-off-by: Marc 'risson' Schmitt --- authentik/core/tests/test_users_avatars.py | 1 + authentik/policies/reputation/models.py | 1 - authentik/tenants/apps.py | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/authentik/core/tests/test_users_avatars.py b/authentik/core/tests/test_users_avatars.py index 98381db0f..01f703c61 100644 --- a/authentik/core/tests/test_users_avatars.py +++ b/authentik/core/tests/test_users_avatars.py @@ -19,6 +19,7 @@ class TestUsersAvatars(APITestCase): self.user = User.objects.create(username="test-user") def set_avatar_mode(self, mode: str): + """Set the avatar mode on the current tenant.""" tenant = get_current_tenant() tenant.avatars = mode tenant.save() diff --git a/authentik/policies/reputation/models.py b/authentik/policies/reputation/models.py index e11b69520..e2b216b44 100644 --- a/authentik/policies/reputation/models.py +++ b/authentik/policies/reputation/models.py @@ -11,7 +11,6 @@ from rest_framework.serializers import BaseSerializer from structlog import get_logger from authentik.core.models import ExpiringModel -from authentik.lib.config import CONFIG from authentik.lib.models import SerializerModel from authentik.lib.utils.http import get_client_ip from authentik.policies.models import Policy diff --git a/authentik/tenants/apps.py b/authentik/tenants/apps.py index 2e21f5208..eecec031c 100644 --- a/authentik/tenants/apps.py +++ b/authentik/tenants/apps.py @@ -5,7 +5,7 @@ from django.db.models.signals import post_migrate from authentik.blueprints.apps import ManagedAppConfig -def reconcile_default_tenant(using=DEFAULT_DB_ALIAS, *args, **kwargs): +def reconcile_default_tenant(*args, using=DEFAULT_DB_ALIAS, **kwargs): """Make sure default tenant exists""" from authentik.tenants.models import Tenant @@ -24,5 +24,6 @@ class AuthentikTenantsConfig(ManagedAppConfig): default = True def reconcile_default_tenant(self): + """Make sure default tenant exists, especially after a migration""" reconcile_default_tenant() post_migrate.connect(reconcile_default_tenant)