From 5c3510fe7ccaa6503895b9a60d9f4b903cebf384 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 7 Oct 2019 13:11:58 +0100 Subject: [PATCH] Setting.format() should effect when you change a setting, mostly for SensitiveSetting --- modules/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/config.py b/modules/config.py index 5b76f376..9a5cd841 100644 --- a/modules/config.py +++ b/modules/config.py @@ -114,14 +114,16 @@ class Module(ModuleManager.BaseModule): def _config(self, export_settings, target, setting, value=None): if not value == None: + setting_object = export_settings[setting] try: - validated_value = export_settings[setting].parse(value) + validated_value = setting_object.parse(value) except utils.SettingParseException as e: raise ConfigInvalidValue(str(e)) if not validated_value == None: target.set_setting(setting, validated_value) - return ConfigResult(ConfigResults.Changed, validated_value) + formatted_value = setting_object.format(validated_value) + return ConfigResult(ConfigResults.Changed, formatted_value) else: raise ConfigInvalidValue() else: