diff --git a/apps/settings/signal_handlers.py b/apps/settings/signal_handlers.py index 8f585a2aa..818b7ba03 100644 --- a/apps/settings/signal_handlers.py +++ b/apps/settings/signal_handlers.py @@ -93,7 +93,8 @@ def subscribe_settings_change(sender, **kwargs): def monkey_patch_settings(sender, **kwargs): def monkey_patch_getattr(self, name): val = getattr(self._wrapped, name) - if callable(val): + # 只解析 defaults 中的 callable + if callable(val) and val.__module__ == 'jumpserver.conf': val = val() return val