Skip to content

Commit

Permalink
Fix #410 (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogost authored Jun 22, 2020
1 parent 2eb3fce commit 79db604
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion constance/checks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.core import checks
from django.utils.translation import ugettext_lazy as _

from . import settings


@checks.register("constance")
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 79db604

Please sign in to comment.