Module: check_mk
Branch: master
Commit: c0c01e48000affe23e3c3eebe71a2318e9dfac06
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0c01e48000aff…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 11 08:36:34 2017 +0200
Fixed issues with tooltips while editing views
Change-Id: Id5663bde50c7f52da13ab69d2171d4cb78d97957
---
web/htdocs/valuespec.py | 6 +++---
web/htdocs/views.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 3a2301e..4fb02bb 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1569,7 +1569,7 @@ class DropdownChoice(ValueSpec):
self._sorted = kwargs.get("sorted", False)
self._empty_text = kwargs.get("empty_text", _("There are
no elements defined for this selection yet."))
self._invalid_choice = kwargs.get("invalid_choice",
"complain") # also possible: "replace"
- self._invalid_choice_title = kwargs.get("invalid_choice_title",
_("Element does not exist anymore"))
+ self._invalid_choice_title = kwargs.get("invalid_choice_title",
_("Element '%r' does not exist anymore"))
self._invalid_choice_error = kwargs.get("invalid_choice_error",
_("The selected element is not longer available. Please select something
else."))
self._no_preselect = kwargs.get("no_preselect", False)
@@ -1634,8 +1634,8 @@ class DropdownChoice(ValueSpec):
def _get_invalid_choice_title(self, value):
- if "%s" in self._invalid_choice_title:
- return self._invalid_choice_title % value
+ if "%s" in self._invalid_choice_title or "%r" in
self._invalid_choice_title:
+ return self._invalid_choice_title % (value,)
else:
return self._invalid_choice_title
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index d1c0bd6..4ca2962 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1293,7 +1293,7 @@ def transform_view_to_valuespec_value(view):
else:
pname, viewname = entry
- columns.append((pname, viewname, ''))
+ columns.append((pname, viewname, None))
def transform_valuespec_value_to_view(view):