Skip to content

Commit

Permalink
fix services page - Python 3 style sorted() rockstor#2564
Browse files Browse the repository at this point in the history
"cmp" sorted parameter and buildin function dropped
in Python 3.
  • Loading branch information
phillxnet committed Jun 3, 2023
1 parent 31a273a commit b179416
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rockstor/smart_manager/views/base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ def get_queryset(self, *args, **kwargs):
sos = []
for s in Service.objects.all():
sos.append(self._get_or_create_sso(s))
return sorted(
sos, cmp=lambda x, y: cmp(x.display_name, y.display_name)
) # noqa
# https://docs.python.org/3.6/howto/sorting.html#key-functions
return sorted(sos, key=lambda each: each.display_name)


class BaseServiceDetailView(ServiceMixin, rfc.GenericView):
Expand Down

0 comments on commit b179416

Please sign in to comment.