Skip to content

Commit

Permalink
partially fix users page - Python 3 style sorted() rockstor#2564
Browse files Browse the repository at this point in the history
"cmp" sorted parameter and builtin function dropped
in Python 3.
Partial fix as only Admin users showing - suspect unrelated
issue.
  • Loading branch information
phillxnet committed Jun 3, 2023
1 parent b179416 commit 9a4dd5f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/rockstor/storageadmin/views/ug_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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())

0 comments on commit 9a4dd5f

Please sign in to comment.