Module: check_mk
Branch: master
Commit: dac6dc0850065ab753a9fec3063d5d68916ddb83
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dac6dc0850065a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 3 23:00:03 2018 +0200
Fixed incompletely configured dashlets being added to dashboards
Change-Id: I148a03e058950ae16be3e4a70c77abc8aa89265c
---
cmk/gui/dashboard.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cmk/gui/dashboard.py b/cmk/gui/dashboard.py
index e0e888f..506f7dd 100644
--- a/cmk/gui/dashboard.py
+++ b/cmk/gui/dashboard.py
@@ -1098,8 +1098,7 @@ def page_edit_dashlet():
'single_infos' : dashlet_type.single_infos(),
'type' : ty,
}
- ident = len(dashboard['dashlets'])
- dashboard['dashlets'].append(dashlet)
+ ident = len(dashboard['dashlets'])
single_infos_raw = html.var('single_infos')
single_infos = []
@@ -1223,6 +1222,9 @@ def page_edit_dashlet():
if context_specs:
dashlet['context'] =
visuals.process_context_specs(context_specs)
+ if mode == "add":
+ dashboard['dashlets'].append(dashlet)
+
visuals.save('dashboards', dashboards)
html.immediate_browser_redirect(1, next_url)