Module: check_mk
Branch: master
Commit: 877cd231242b66762e4d1fac9f10dc7abf72aba0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=877cd231242b66…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 5 12:39:35 2018 +0100
5881 FIX Tag condition editor could show wrong tag selection after submission
Change-Id: Ib840f5571ceefae0d685c69740549e0ae2954e1a
---
.werks/5881 | 11 +++++++++++
web/htdocs/watolib.py | 6 +++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/5881 b/.werks/5881
new file mode 100644
index 0000000..7e25c75
--- /dev/null
+++ b/.werks/5881
@@ -0,0 +1,11 @@
+Title: Tag condition editor could show wrong tag selection after submission
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i4
+Date: 1520249655
+
+
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index a56ba3f..3bdaa27 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -7086,18 +7086,18 @@ def render_condition_editor(tag_specs, varprefix=""):
# Show dropdown with "is/isnot/ignore" and beginning
# of div that is switched visible by is/isnot
def tag_condition_dropdown(tagtype, deflt, id):
-
html.open_td()
+ dropdown_id = varprefix + tagtype + "_" + id
onchange="valuespec_toggle_dropdownn(this, '%stag_sel_%s');" %
(varprefix, id)
choices = [("ignore", _("ignore")),
("is", _("is")),
("isnot", _("isnot"))]
- html.dropdown(varprefix + tagtype + "_" + id, choices, deflt=deflt,
onchange=onchange)
+ html.dropdown(dropdown_id, choices, deflt=deflt, onchange=onchange)
html.close_td()
html.open_td(class_="tag_sel")
if html.form_submitted():
- div_is_open = html.var(tagtype + "_" + id, "ignore") !=
"ignore"
+ div_is_open = html.var(dropdown_id, "ignore") !=
"ignore"
else:
div_is_open = deflt != "ignore"
html.open_div(id_="%stag_sel_%s" % (varprefix, id),
style="display: none;" if not div_is_open else None)