From da11ab8bc769e8d3149decd2acb6a0185f7ad268 Mon Sep 17 00:00:00 2001 From: tanshu Date: Fri, 14 Oct 2016 16:03:15 +0530 Subject: [PATCH] fix: Sort Permissions in Group List --- brewman/views/auth/group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brewman/views/auth/group.py b/brewman/views/auth/group.py index e76601c8..7fa157e0 100644 --- a/brewman/views/auth/group.py +++ b/brewman/views/auth/group.py @@ -77,9 +77,9 @@ def show_list(request): list = DBSession.query(Group).order_by(Group.name).all() groups = [] - for item in sorted(list, key=lambda permission:permission.name): + for item in list: group = {'Name': item.name, 'Permissions': [], 'Url': request.route_url('group_id', id=item.id)} - for permission in item.roles: + for permission in sorted(item.roles, key=lambda p:p.name): group['Permissions'].append(permission.name) groups.append(group) return groups