diff --git a/src/rockstor/storageadmin/views/ug_helpers.py b/src/rockstor/storageadmin/views/ug_helpers.py index a3d4416a4..7c569c1b1 100644 --- a/src/rockstor/storageadmin/views/ug_helpers.py +++ b/src/rockstor/storageadmin/views/ug_helpers.py @@ -77,9 +77,7 @@ def combined_users(): for u in User.objects.all(): if u.username not in uname_list: users.append(u) - return sorted( - users, cmp=lambda x, y: cmp(x.username.lower(), y.username.lower()) # noqa F821 - ) + return sorted(users, key=lambda each: each.username.lower()) def combined_groups(): @@ -97,7 +95,4 @@ def combined_groups(): for g in Group.objects.all(): if g.groupname not in gname_list: groups.append(g) - return sorted( - groups, - cmp=lambda x, y: cmp(x.groupname.lower(), y.groupname.lower()), # noqa F821 - ) + return sorted(groups, key=lambda each: each.groupname.lower())