From 1c34c8caf88dd118c73197055ab68ab05872cd74 Mon Sep 17 00:00:00 2001 From: Tester Date: Jun 20 2022 07:32:00 +0000 Subject: PR#3368: Order channels at hosts page Merges #3368 https://pagure.io/koji/pull-request/3368 Fixes: #3367 https://pagure.io/koji/issue/3367 Channels at hosts page are not ordered --- diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index b2da61c..de39ca7 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -1685,7 +1685,8 @@ def hosts(environ, state='enabled', start=None, order='name', ready='all', chann host['channels'] = [] host['channels_id'] = [] host['channels_enabled'] = [] - for chan in channels.result: + channels = sorted(channels.result, key=lambda x: x['name']) + for chan in channels: host['channels'].append(chan['name']) host['channels_id'].append(chan['id']) if chan['enabled']: