Module: check_mk
Branch: master
Commit: dcf180d91e54e8a6755cf57879447a5e3187e32d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dcf180d91e54e8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 25 09:35:49 2018 +0200
6366 FIX User and profile edit dialogs show wrong language when 'en' is
configured
When a user has a legacy value 'en' configured as it's language the value was
not
transformed to the correct value making the form show up "German" as selected
language instead of "English". After saving the user language was switched to
German accidentally.
Change-Id: I5ddcce482659046e82f7ce33854689910d31859c
---
.werks/6366 | 14 ++++++++++++++
cmk/gui/wato/__init__.py | 5 +++++
2 files changed, 19 insertions(+)
diff --git a/.werks/6366 b/.werks/6366
new file mode 100644
index 0000000..239de4d
--- /dev/null
+++ b/.werks/6366
@@ -0,0 +1,14 @@
+Title: User and profile edit dialogs show wrong language when 'en' is configured
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1532503987
+
+When a user has a legacy value 'en' configured as it's language the value was
not
+transformed to the correct value making the form show up "German" as selected
+language instead of "English". After saving the user language was switched to
+German accidentally.
diff --git a/cmk/gui/wato/__init__.py b/cmk/gui/wato/__init__.py
index 6712841..47f034e 100644
--- a/cmk/gui/wato/__init__.py
+++ b/cmk/gui/wato/__init__.py
@@ -13690,6 +13690,11 @@ def select_language(user):
html.open_div(id_="attr_entry_language", style="display:
none" if not active else "")
language = user.get('language') if user.get('language') != None
else ''
+
+ # Transform 'en' configured language to empty string for compatibility
reasons
+ if language == "en":
+ language = ""
+
html.dropdown("language", languages, deflt=language)
html.close_div()
html.help(_('Configure the default language '