Browse Source

perf: 修复 settings patch 问题

pull/7983/head
ibuler 3 years ago committed by 老广
parent
commit
e303b4f571
  1. 3
      apps/settings/signal_handlers.py

3
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

Loading…
Cancel
Save