diff --git a/src/wagtail_localize_smartling/apps.py b/src/wagtail_localize_smartling/apps.py index 10d7ccf..145e8e0 100644 --- a/src/wagtail_localize_smartling/apps.py +++ b/src/wagtail_localize_smartling/apps.py @@ -6,3 +6,6 @@ class WagtailLocalizeSmartlingAppConfig(AppConfig): label = "wagtail_localize_smartling" name = "wagtail_localize_smartling" verbose_name = "Wagtail Localize Smartling" + + def ready(self): + from . import checks, signals # noqa: F401 diff --git a/src/wagtail_localize_smartling/checks.py b/src/wagtail_localize_smartling/checks.py index 26b9d42..ab88cf4 100644 --- a/src/wagtail_localize_smartling/checks.py +++ b/src/wagtail_localize_smartling/checks.py @@ -1 +1,19 @@ -# TODO check required settings +from django.core.checks import Error, register +from django.core.exceptions import ImproperlyConfigured + +from .settings import settings as smartling_settings + + +@register() +def smartling_settings_check(app_configs, **kwargs): + errors = [] + try: + str(smartling_settings.PROJECT_ID) + except ImproperlyConfigured as e: + errors.append( + Error( + e.args[0], + id="wagtail_localize_smartling.E001", + ) + ) + return errors