Module: check_mk
Branch: master
Commit: a05b5c6d1c4d214c4bc9f66d9160501bfc537750
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a05b5c6d1c4d21…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 13 14:52:47 2018 +0200
6348 FIX Contact groups in notification rule conditions are now sorted
Change-Id: Ic6ba060f13037aa6e3ea033c93c2fdb1382dfe77
---
.werks/6348 | 11 +++++++++++
cmk/gui/userdb.py | 5 +++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/6348 b/.werks/6348
new file mode 100644
index 0000000..883ad0e
--- /dev/null
+++ b/.werks/6348
@@ -0,0 +1,11 @@
+Title: Contact groups in notification rule conditions are now sorted
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1531486339
+
+
diff --git a/cmk/gui/userdb.py b/cmk/gui/userdb.py
index 02a1dd5..567f5ad 100644
--- a/cmk/gui/userdb.py
+++ b/cmk/gui/userdb.py
@@ -1086,8 +1086,9 @@ class GroupChoice(DualListChoice):
def load_groups(self, with_foreign_groups):
all_groups = load_group_information()
this_group = all_groups.get(self.what, {})
- return [ (k, t['alias'] and t['alias'] or k) for (k, t) in
this_group.items()
- if with_foreign_groups or k in config.user.contact_groups() ]
+ return sorted([ (k, t['alias'] and t['alias'] or k) for (k, t) in
this_group.items()
+ if with_foreign_groups or k in config.user.contact_groups() ],
+ key=lambda x: x[1].lower())
#.