From 5b39f8e68b3aad141d85073f8d30f3d33bd79803 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Tue, 9 Jan 2024 16:39:32 +0100 Subject: [PATCH] Revert "try with setting_changed signal" This reverts commit 32b40a3bbb4ee01f87a9cf0fcac6f58ba55967a2. --- authentik/tenants/apps.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/authentik/tenants/apps.py b/authentik/tenants/apps.py index e8af0e361..b3aef51a9 100644 --- a/authentik/tenants/apps.py +++ b/authentik/tenants/apps.py @@ -1,5 +1,4 @@ """authentik tenants app""" -from django.core.signals import setting_changed from django.db import DEFAULT_DB_ALIAS from django.db.models.signals import post_migrate from django_tenants.utils import get_public_schema_name @@ -7,7 +6,7 @@ from django_tenants.utils import get_public_schema_name from authentik.blueprints.apps import ManagedAppConfig -def ensure_default_tenant(*args, using=DEFAULT_DB_ALIAS, **kwargs): +def reconcile_default_tenant(*args, using=DEFAULT_DB_ALIAS, **kwargs): """Make sure default tenant exists""" from django_tenants.utils import schema_context @@ -30,6 +29,5 @@ class AuthentikTenantsConfig(ManagedAppConfig): def reconcile_default_tenant(self): """Make sure default tenant exists, especially after a migration""" - ensure_default_tenant() - post_migrate.connect(ensure_default_tenant) - setting_changed.connect(ensure_default_tenant) + reconcile_default_tenant() + post_migrate.connect(reconcile_default_tenant)