Module: check_mk
Branch: master
Commit: ce9911264fd40d055fe2e371a52a7b36ac0877c4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce9911264fd40d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 2 16:42:17 2016 +0200
Fixed exception in alert handler config when trying to create rule without having
handlers
---
web/htdocs/valuespec.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index e595093..f6acd80 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1613,6 +1613,13 @@ class CascadingDropdown(ValueSpec):
def from_html_vars(self, varprefix):
choices = self.choices()
+
+ # No choices and "no elements text" is shown: The html var is
+ # not present and no choice can be made. So fallback to default
+ # value and let the validation methods lead to an error message.
+ if not choices:
+ return self.default_value()
+
try:
sel = int(html.var(varprefix + "_sel"))
except: