Skip to content

Commit

Permalink
show not existing fields in field_list (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
horida authored and camilonova committed Oct 11, 2018
1 parent ce565ec commit 286edca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions constance/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ def changelist_view(self, request, extra_context=None):
if settings.CONFIG_FIELDSETS:
context['fieldsets'] = []
for fieldset_title, fields_list in settings.CONFIG_FIELDSETS.items():
fields_exist = all(field in settings.CONFIG for field in fields_list)
assert fields_exist, "CONSTANCE_CONFIG_FIELDSETS contains field(s) that does not exist"
absent_fields = [field for field in fields_list
if field not in settings.CONFIG]
assert not any(absent_fields), (
"CONSTANCE_CONFIG_FIELDSETS contains field(s) that does "
"not exist: %s" % ', '.join(absent_fields))

config_values = []

for name in fields_list:
Expand Down

0 comments on commit 286edca

Please sign in to comment.