Module: check_mk
Branch: master
Commit: 0af69dc0db797d7d788afb6f83a23a2eadef757d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0af69dc0db797d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Mar 4 09:47:41 2015 +0100
fixed encoding bug even better
---
web/htdocs/htmllib.py | 4 +++-
web/plugins/sidebar/wato.py | 2 --
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index e4dbbb3..d70fcc7 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1069,8 +1069,10 @@ class html:
def var_utf8(self, varname, deflt = None):
val = self.vars.get(varname, deflt)
- if val != None:
+ if val != None and type(val) != unicode:
return val.decode("utf-8")
+ else:
+ return val
# Return all values of a variable that possible occurs more
# than once in the URL. note: self.listvars does contain those
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 67ecc45..cb3adfc 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -227,8 +227,6 @@ def render_wato_foldertree():
# Render link target selection
#
selected_topic, selected_target = config.load_user_file("foldertree",
(_('Hosts'), 'allhosts'))
- if type(selected_topic) == unicode:
- selected_topic = selected_topic.encode("utf-8")
views.load_views()
dashboard.load_dashboards()