The changed value of a multiline/text control was not saved in the

configuration database due to unable to identify the change properly.
Thanks Dave for reporting.

This also includes a support to use a 'text' type of preference, and
show help string next to the control.
This commit is contained in:
Ashesh Vashi
2016-03-24 12:58:46 +05:30
parent a28df1e0a2
commit 7bce6dd903
2 changed files with 36 additions and 16 deletions

View File

@@ -368,7 +368,7 @@ class Preferences(object):
assert _type is not None, "Type for a preference can not be none!"
assert _type in (
'boolean', 'integer', 'numeric', 'date', 'datetime',
'options', 'multiline', 'switch', 'node'
'options', 'multiline', 'switch', 'node', 'text'
), "Type can not be found in the defined list!"
(cat['preferences'])[name] = res = _Preference(
@@ -523,6 +523,7 @@ Did you forget to register it?"""
try:
pref.set(value)
except Exception as e:
current_app.logger.exeception(e)
return False, str(e)
return True, None