Files
authentik/authentik/core/apps.py
Jens L ebd05be2c4 root: simplify task signal imports (#8454)
* *: deduplicate boilerplate for importing related models

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* also auto-import .checks

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix error during prometheus metrics from #8435

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2024-02-08 12:44:33 +00:00

35 lines
944 B
Python

"""authentik core app config"""
from django.conf import settings
from authentik.blueprints.apps import ManagedAppConfig
class AuthentikCoreConfig(ManagedAppConfig):
"""authentik core app config"""
name = "authentik.core"
label = "authentik_core"
verbose_name = "authentik Core"
mountpoint = ""
default = True
def reconcile_global_debug_worker_hook(self):
"""Dispatch startup tasks inline when debugging"""
if settings.DEBUG:
from authentik.root.celery import worker_ready_hook
worker_ready_hook()
def reconcile_tenant_source_inbuilt(self):
"""Reconcile inbuilt source"""
from authentik.core.models import Source
Source.objects.update_or_create(
defaults={
"name": "authentik Built-in",
"slug": "authentik-built-in",
},
managed="goauthentik.io/sources/inbuilt",
)