From a01982ae5523b2f1689bbdca480359e06e7cec51 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 31 Dec 2022 17:57:22 -0600 Subject: [PATCH] Show only "core" app settings by default --- tailbone/views/settings.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tailbone/views/settings.py b/tailbone/views/settings.py index c38e3136..9a1e8620 100644 --- a/tailbone/views/settings.py +++ b/tailbone/views/settings.py @@ -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