From e303b4f5710ae9a1c69f78544515da5ed61a3836 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 28 Mar 2022 11:27:35 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=20settings=20patch?= =?UTF-8?q?=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/settings/signal_handlers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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