Module: check_mk
Branch: master
Commit: 69488c0589402fcc40bfa35c9aeae0902cb7511b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69488c0589402f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jan 25 18:47:31 2012 +0100
Cosmetic code cleanup
---
web/htdocs/lib.py | 6 ++++--
web/htdocs/wato.py | 18 +++++++++---------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index cd5f0e9..33f86c4 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -140,9 +140,11 @@ def get_languages():
for lang_dir in get_language_dirs():
try:
- languages += [ (val, get_language_alias(val)) for val in os.listdir(lang_dir)
if not '.' in val ]
+ languages += [ (val, get_language_alias(val))
+ for val in os.listdir(lang_dir) if not '.' in val ]
except OSError:
- # Catch "OSError: [Errno 2] No such file or directory:" when
directory not exists
+ # Catch "OSError: [Errno 2] No such file or
+ # directory:" when directory not exists
pass
return languages
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a05edf0..f59b94a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9116,17 +9116,15 @@ def page_user_profile():
try:
users = load_users()
- #
# Profile edit (user options like language etc.)
- #
if config.may('edit_profile'):
set_lang = html.var('_set_lang')
language = html.var('language')
# Set the users language if requested
if set_lang and language and language != config.get_language():
- # Set custom language
- users[config.user_id]['language'] = language
- config.user['language'] = language
+ # Set custom language
+ users[config.user_id]['language'] = language
+ config.user['language'] = language
else:
# Remove the customized language
@@ -9138,9 +9136,7 @@ def page_user_profile():
# load the new language
load_language(config.get_language())
- #
# Change the password if requested
- #
if config.may('change_password'):
password = html.var('password')
password2 = html.var('password2', '')
@@ -9154,13 +9150,17 @@ def page_user_profile():
success = True
if password:
- html.write("<script type='text/javascript'>if(top)
top.location.reload(); else document.location.reload();</script>")
+ html.javascript(
+ "if(top) top.location.reload(); "
+ "else document.location.reload();")
else:
html.reload_sidebar()
except MKUserError, e:
html.add_user_error(e.varname, e.message)
- html.header(_("Edit user profile"), javascripts = ['wato'],
stylesheets = ['check_mk', 'pages', 'wato', 'status'])
+ html.header(_("Edit user profile"),
+ javascripts = ['wato'],
+ stylesheets = ['check_mk', 'pages', 'wato',
'status'])
if success:
html.message(_("Successfully updated user profile."))