This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/oauth_client/apps.py

27 lines
781 B
Python
Raw Normal View History

2018-11-11 12:41:48 +00:00
"""passbook oauth_client config"""
2018-11-16 08:10:35 +00:00
from importlib import import_module
2018-11-11 12:41:48 +00:00
from logging import getLogger
2018-11-16 08:10:35 +00:00
2018-11-11 12:41:48 +00:00
from django.apps import AppConfig
2018-11-16 08:10:35 +00:00
2018-11-11 12:41:48 +00:00
from passbook.lib.config import CONFIG
2018-11-16 08:10:35 +00:00
2018-11-11 12:41:48 +00:00
LOGGER = getLogger(__name__)
class PassbookOAuthClientConfig(AppConfig):
"""passbook oauth_client config"""
name = 'passbook.oauth_client'
label = 'passbook_oauth_client'
verbose_name = 'passbook OAuth Client'
def ready(self):
"""Load source_types from config file"""
source_types_to_load = CONFIG.y('oauth_client.source_tyoes')
for source_type in source_types_to_load:
try:
import_module(source_type)
LOGGER.info("Loaded %s", source_type)
except ImportError as exc:
LOGGER.debug(exc)