Module: check_mk
Branch: master
Commit: 3a27d9f207a2304c0ebbaae387e51d5bfa49a25e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a27d9f207a230…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 17 11:10:43 2017 +0200
4998 FIX View editor: Fixed sorting of sorte choices
Change-Id: I04b86b3b8742c8611784b37c403b348bc09e2e3f
---
.werks/4998 | 10 ++++++++++
web/htdocs/htmllib.py | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/4998 b/.werks/4998
new file mode 100644
index 0000000..0f4aabb
--- /dev/null
+++ b/.werks/4998
@@ -0,0 +1,10 @@
+Title: View editor: Fixed sorting of sorte choices
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1500282625
+Class: fix
+
+
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index f35f0a9..0eacf82 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -2381,13 +2381,13 @@ class html(HTMLGenerator, RequestHandler):
chs = choices[:]
if sorted:
# Sort according to display texts, not keys
- chs.sort(lambda a,b: cmp(a[1].lower(), b[1].lower()))
+ chs.sort(key=lambda a: a[1].lower())
if error:
self.open_x(class_="inputerror")
self.open_select(name=varname, id_=varname, **attrs)
- for value, text in choices:
+ for value, text in chs:
# if both the default in choices and current was '' then selected
depended on the order in choices
selected = (value == current) or (not value and not current)
self.option(text, value=value if value else "",