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
This commit is contained in:
Tester 2022-06-20 09:32:00 +02:00
commit 1c34c8caf8

View file

@ -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']: