Module: check_mk
Branch: master
Commit: 761cb08d489919eb5fdbb891c71a7036ae35dc49
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=761cb08d489919…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 24 16:19:17 2014 +0200
Fixed further bug in edit_dictionary
---
web/htdocs/forms.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index 9532842..7a7c392 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -63,15 +63,15 @@ def edit_dictionaries(dictionaries, value, focus=None,
hover_help=True,
else:
sections.append((keyname, None, d)) # valuespec Dictionary, title used from
dict
- new_value = value.copy()
if html.var("filled_in") == formname and html.transaction_valid():
if not preview and consume_transid:
html.check_transaction()
messages = []
+ new_value = {}
for keyname, section_title, entries in sections:
+ new_value[keyname] = value.get(keyname, {}).copy()
if type(entries) == list:
- new_value[keyname] = {}
for name, vs in entries:
if len(sections) == 1:
vp = varprefix
@@ -87,8 +87,9 @@ def edit_dictionaries(dictionaries, value, focus=None, hover_help=True,
else:
try:
- new_value[keyname] = entries.from_html_vars(keyname)
- entries.validate_value(new_value[keyname], keyname)
+ edited_value = entries.from_html_vars(keyname)
+ entries.validate_value(edited_value, keyname)
+ new_value[keyname].update(edited_value)
except Exception, e:
messages.append("%s: %s" % (entries.title() or
_("Properties"), e.message))
html.add_user_error(e.varname, e.message)