Module: check_mk
Branch: master
Commit: 27232c9f0beafb3a153e7d8ecd4b08cdee9a7ad6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27232c9f0beafb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jun 27 17:56:32 2013 +0200
Fix validator for WATO rules
---
web/htdocs/valuespec.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 40fbd94..09b50bc 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -664,8 +664,9 @@ class ListOfStrings(ValueSpec):
def validate_value(self, value, vp):
if len(value) == 0 and not self._allow_empty:
raise MKUserError(vp + "_0", _("Please specify at least one
value"))
- for nr, s in enumerate(value):
- self._valuespec.validate_value(s, vp + "_%d" % nr)
+ if self._valuespec:
+ for nr, s in enumerate(value):
+ self._valuespec.validate_value(s, vp + "_%d" % nr)
ValueSpec.custom_validate(self, value, vp)
# Generic list-of-valuespec ValueSpec with Javascript-based