From 79db604954d2bffc5eeb0956592179de2901dd0f Mon Sep 17 00:00:00 2001 From: Alexandr Artemyev Date: Tue, 23 Jun 2020 01:31:13 +0300 Subject: [PATCH] Fix #410 (#412) --- constance/checks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/constance/checks.py b/constance/checks.py index de66029..4f47d30 100644 --- a/constance/checks.py +++ b/constance/checks.py @@ -1,7 +1,6 @@ from django.core import checks from django.utils.translation import ugettext_lazy as _ -from . import settings @checks.register("constance") @@ -10,6 +9,8 @@ def check_fieldsets(*args, **kwargs): A Django system check to make sure that, if defined, CONFIG_FIELDSETS accounts for every entry in settings.CONFIG. """ + from . import settings + if hasattr(settings, "CONFIG_FIELDSETS") and settings.CONFIG_FIELDSETS: inconsistent_fieldnames = get_inconsistent_fieldnames() if inconsistent_fieldnames: @@ -33,6 +34,8 @@ def get_inconsistent_fieldnames(): settings.CONFIG_FIELDSETS. If there are no fieldnames in settings.CONFIG_FIELDSETS, returns an empty set. """ + from . import settings + field_name_list = [] for fieldset_title, fields_list in settings.CONFIG_FIELDSETS.items(): for field_name in fields_list: