Module: check_mk
Branch: master
Commit: 4b16078877c203908b9e2fc750ce5444479681c7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b16078877c203…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 27 10:14:10 2017 +0200
5425 FIX Fixed broken bookmark list management for users with non ascii characters in User
IDs
Change-Id: Ic7ddd70e310fa708be8273c96180a242f4a21c8f
---
.werks/5425 | 11 +++++++++++
web/htdocs/pagetypes.py | 8 ++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.werks/5425 b/.werks/5425
new file mode 100644
index 0000000..65351c3
--- /dev/null
+++ b/.werks/5425
@@ -0,0 +1,11 @@
+Title: Fixed broken bookmark list management for users with non ascii characters in User
IDs
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1509091834
+
+
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index 989fbb5..1510f52 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -715,10 +715,10 @@ class Overridable(Base):
cls.add_instance(("", name), new_page)
# Now scan users subdirs for files "user_$type_name.mk"
- subdirs = os.listdir(config.config_dir)
- for user in subdirs:
+ for user in os.listdir(config.config_dir):
+ user = user.decode("utf-8")
try:
- path = "%s/%s/user_%ss.mk" % (config.config_dir, user,
cls.type_name())
+ path = "%s/%s/user_%ss.mk" % (config.config_dir,
user.encode("utf-8"), cls.type_name())
if not os.path.exists(path):
continue
@@ -1026,7 +1026,7 @@ class Overridable(Base):
cls.remove_instance((owner_user_id, page_name)) # will be added later
again
else: # clone
title = cls.phrase("clone")
- load_user = html.var("load_user") # FIXME: Change varname to
"owner"
+ load_user = html.var_utf8("load_user") # FIXME: Change varname
to "owner"
page = cls.instance((load_user, page_name))
page_dict = page.internal_representation()