Module: check_mk
Branch: master
Commit: bf65284f1fe682c63dc2f9a9a8e17d0dec431d41
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf65284f1fe682…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 18 16:06:27 2012 +0200
ValueSpec DropdownChoice: handle yet other case with no choices
---
web/htdocs/valuespec.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 2219a3c..775878a 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -795,7 +795,7 @@ class DropdownChoice(ValueSpec):
val = entry[0]
if sel == str(n):
return val
- return self.choices()[0][0] # can only happen if user garbled URL
+ return self.default_value() # can only happen if user garbled URL or len(choices)
== 0
def validate_datatype(self, value, varprefix):
for val, title in self.choices():