*(minor): small refactor

This commit is contained in:
Langhammer, Jens
2019-10-07 16:33:48 +02:00
parent d21ec6c9a5
commit f2acc154cd
300 changed files with 1420 additions and 1788 deletions

View File

@ -0,0 +1,25 @@
"""passbook oauth_client config"""
from importlib import import_module
from django.apps import AppConfig
from django.conf import settings
from structlog import get_logger
LOGGER = get_logger()
class PassbookSourceOAuthConfig(AppConfig):
"""passbook source.oauth config"""
name = 'passbook.sources.oauth'
label = 'passbook_sources_oauth'
verbose_name = 'passbook Sources.OAuth'
mountpoint = 'source/oauth/'
def ready(self):
"""Load source_types from config file"""
for source_type in settings.PASSBOOK_SOURCES_OAUTH_TYPES:
try:
import_module(source_type)
LOGGER.info("Loaded source_type", source_class=source_type)
except ImportError as exc:
LOGGER.debug(exc)