Show only "core" app settings by default
This commit is contained in:
parent
884f960d3b
commit
a01982ae55
|
@ -255,11 +255,20 @@ class AppSettingsView(View):
|
|||
"""
|
||||
Iterate over all known settings.
|
||||
"""
|
||||
for module in self.rattail_config.getlist('rattail', 'settings', default=['rattail.settings']):
|
||||
modules = self.rattail_config.getlist('rattail', 'settings')
|
||||
if modules:
|
||||
core_only = False
|
||||
else:
|
||||
modules = ['rattail.settings']
|
||||
core_only = True
|
||||
|
||||
for module in modules:
|
||||
module = import_module_path(module)
|
||||
for name in dir(module):
|
||||
obj = getattr(module, name)
|
||||
if isinstance(obj, type) and issubclass(obj, Setting) and obj is not Setting:
|
||||
if core_only and not obj.core:
|
||||
continue
|
||||
# NOTE: we set this here, and reference it elsewhere
|
||||
obj.node_name = self.get_node_name(obj)
|
||||
yield obj
|
||||
|
|
Loading…
Reference in a new issue