fix: Sort Permissions in Group List

This commit is contained in:
tanshu 2016-10-14 16:03:15 +05:30
parent 4529cd5fca
commit da11ab8bc7

View File

@ -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