From f4441c9fcfd9e620a29b38fb84cbeea55b3d38d6 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 18 Aug 2022 17:42:23 +0200 Subject: [PATCH] providers/proxy: trigger proxy set_defaults task on startup closes #3445 Signed-off-by: Jens Langhammer --- authentik/flows/apps.py | 2 +- authentik/providers/proxy/apps.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/authentik/flows/apps.py b/authentik/flows/apps.py index f02e92023..5908a3aee 100644 --- a/authentik/flows/apps.py +++ b/authentik/flows/apps.py @@ -28,7 +28,7 @@ class AuthentikFlowsConfig(ManagedAppConfig): """Load flows signals""" self.import_module("authentik.flows.signals") - def reconcile_stages_loaded(self): + def reconcile_load_stages(self): """Ensure all stages are loaded""" from authentik.flows.models import Stage diff --git a/authentik/providers/proxy/apps.py b/authentik/providers/proxy/apps.py index ef7d2dd6d..f0b064ff9 100644 --- a/authentik/providers/proxy/apps.py +++ b/authentik/providers/proxy/apps.py @@ -1,10 +1,17 @@ """authentik Proxy app""" -from django.apps import AppConfig +from authentik.blueprints.manager import ManagedAppConfig -class AuthentikProviderProxyConfig(AppConfig): +class AuthentikProviderProxyConfig(ManagedAppConfig): """authentik proxy app""" name = "authentik.providers.proxy" label = "authentik_providers_proxy" verbose_name = "authentik Providers.Proxy" + default = True + + def reconcile_trigger_proxy_set_defaults(self): + """Trigger set_defaults task""" + from authentik.providers.proxy.tasks import proxy_set_defaults + + proxy_set_defaults.delay()