Module: check_mk
Branch: master
Commit: 23020c7e977c3fdd7ca88bd76e1e9964f83049c7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=23020c7e977c3f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 16 10:22:36 2015 +0200
Fixed exception when sending GUI messages to users with special characters in names
---
web/htdocs/notify.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/notify.py b/web/htdocs/notify.py
index 4d9f88f..588c43e 100644
--- a/web/htdocs/notify.py
+++ b/web/htdocs/notify.py
@@ -30,7 +30,7 @@ from valuespec import *
def get_gui_messages(user_id = None):
if user_id is None:
user_id = config.user_id
- path = config.config_dir + "/" + user_id + '/messages.mk'
+ path = config.config_dir + "/" + user_id.encode("utf-8") +
'/messages.mk'
try:
messages = eval(file(path).read())
@@ -61,7 +61,7 @@ def delete_gui_message(msg_id):
def save_gui_messages(messages, user_id = None):
if user_id is None:
user_id = config.user_id
- path = config.config_dir + "/" + user_id + '/messages.mk'
+ path = config.config_dir + "/" + user_id.encode("utf-8") +
'/messages.mk'
make_nagios_directory(os.path.dirname(path))
file(path, 'w').write(repr(messages) + "\n")