# Path: sitegate/settings.py
# APP_MODULE_NAME = getattr(settings, 'SITEGATE_APP_MODULE_NAME', 'sitegates')


from functools import WRAPPER_ASSIGNMENTS
from functools import wraps
from typing import Dict
from django.contrib.auth import get_user_model
from etc.toolbox import import_project_modules
from .settings import APP_MODULE_NAME
    from .signin_flows.remotes.base import Remote  # noqa
"""Contains utility functions used by sitegate."""



_REMOTES_REGISTRY: Dict[str, 'Remote'] = {}
"""Remote services available for sign in through. Indexed by their aliases."""

USER = get_user_model()

get_username_field = lambda: getattr(USER, 'USERNAME_FIELD', 'username')

if False:  # pragma: nocover


def available_attrs(fn):
    return WRAPPER_ASSIGNMENTS


def import_project_sitegate_modules():
    """Imports sitegates modules from registered apps."""

# Path: sitegate/settings.py
# APP_MODULE_NAME = getattr(settings, 'SITEGATE_APP_MODULE_NAME', 'sitegates')


# Path: sitegate/utils.py
from functools import WRAPPER_ASSIGNMENTS
from functools import wraps
from typing import Dict
from django.contrib.auth import get_user_model
from etc.toolbox import import_project_modules
from .settings import APP_MODULE_NAME
    from .signin_flows.remotes.base import Remote  # noqa

"""Contains utility functions used by sitegate."""



_REMOTES_REGISTRY: Dict[str, 'Remote'] = {}
"""Remote services available for sign in through. Indexed by their aliases."""

USER = get_user_model()

get_username_field = lambda: getattr(USER, 'USERNAME_FIELD', 'username')

if False:  # pragma: nocover


def available_attrs(fn):
    return WRAPPER_ASSIGNMENTS


def import_project_sitegate_modules():
    """Imports sitegates modules from registered apps."""

    return import_project_modules(APP_MODULE_NAME)