Module: check_mk
Branch: master
Commit: 27cd22c24e46be8fb921bb6c82a845db6581a877
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27cd22c24e46be…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jun 21 14:22:19 2017 +0200
4836 FIX Notifications rules: Modifying a rule always set the option "allow users to
deactivate this notification"
Change-Id: Ic52cad80b5a0d5233fc4137fb73540d9071ab4bd
---
.werks/4836 | 10 ++++++++++
web/htdocs/wato.py | 8 ++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/4836 b/.werks/4836
new file mode 100644
index 0000000..6453ffa
--- /dev/null
+++ b/.werks/4836
@@ -0,0 +1,10 @@
+Title: Notifications rules: Modifying a rule always set the option "allow users to
deactivate this notification"
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1498047540
+Class: fix
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a29e0be..95d112e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8642,8 +8642,12 @@ def mode_notification_rule(phase, profilemode):
vs.validate_value(rule, "rule")
- # User rules are always allow_disable
- rule["allow_disable"] = True
+ if userid:
+ # User rules are always allow_disable
+ # The parameter is set just after the validation, since the allow_disable
+ # key isn't in the valuespec. Curiously, the validation does not fail
+ # even the allow_disable key is set before the validate_value...
+ rule["allow_disable"] = True
if new and clone_nr >= 0:
rules[clone_nr:clone_nr] = [ rule ]