Module: check_mk
Branch: master
Commit: b3b7be532f5c888258268ed7478bc1a98da61dc2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3b7be532f5c88…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Thu Nov 3 16:39:51 2016 +0100
Fixed unicode bug in table.py.
Fixed unicode bug in plugins/views/painters.py
---
web/htdocs/table.py | 4 +++-
web/plugins/views/painters.py | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/table.py b/web/htdocs/table.py
index 31041d1..de478a1 100644
--- a/web/htdocs/table.py
+++ b/web/htdocs/table.py
@@ -115,7 +115,9 @@ def cell(*posargs, **kwargs):
next_args = posargs, kwargs
def add_cell(title="", text="", css=None, help=None, colspan=None,
sortable=True):
- if type(text) not in (unicode, HTML):
+ if type(text) == HTML:
+ text = text.value
+ if type(text) != unicode:
text = str(text)
htmlcode = text + html.drain()
if table["collect_headers"] == True:
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 91b01a9..d6c29b3 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -301,7 +301,7 @@ def process_multisite_icons(what, row, tags, custom_vars, toplevel):
elif type(result) in [str, unicode, HTML]:
if isinstance(result, HTML):
- result = str(result)
+ result = result.value
# TODO: This is handling the deprecated API with 1.2.7. Remove this
one day.
if result[0] == '<':