Module: check_mk
Branch: master
Commit: 42b03d4b681f8ae9d3bfffc1cf07d6243e0a19f2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42b03d4b681f8a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jun 13 11:32:13 2017 +0200
4828 FIX User notification rules can now be canceled
Previously, the cancel notification rule did only apply to global notification rules.
Change-Id: Ice21bf51e0cbaefca3ad9f6af1afbf618421cbb3
---
.werks/4828 | 11 +++++++++++
modules/notify.py | 5 +++++
web/htdocs/wato.py | 3 +++
3 files changed, 19 insertions(+)
diff --git a/.werks/4828 b/.werks/4828
new file mode 100644
index 0000000..38eeb12
--- /dev/null
+++ b/.werks/4828
@@ -0,0 +1,11 @@
+Title: User notification rules can now be canceled
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1497346214
+Class: fix
+
+Previously, the cancel notification rule did only apply to global notification rules.
+
diff --git a/modules/notify.py b/modules/notify.py
index 2b8d67d..2157a08 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -523,6 +523,11 @@ def user_notification_rules():
for contactname in contactnames:
contact = contacts[contactname]
for rule in contact.get("notification_rules", []):
+ # User notification rules always use allow_disable
+ # This line here is for legacy reasons. Newer versions
+ # already set the allow_disable option in the rule configuration
+ rule["allow_disable"] = True
+
# Save the owner of the rule for later debugging
rule["contact"] = contactname
# We assume that the "contact_..." entries in the
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index e3857c7..07f11e6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8637,6 +8637,9 @@ def mode_notification_rule(phase, profilemode):
vs.validate_value(rule, "rule")
+ # User rules are always allow_disable
+ rule["allow_disable"] = True
+
if new and clone_nr >= 0:
rules[clone_nr:clone_nr] = [ rule ]
elif new: