Fix case-sensitivity when sorting permission group labels

This commit is contained in:
Lance Edgar 2016-04-06 21:43:48 -05:00
parent 30e6b6e29c
commit 95b94ef570

View file

@ -71,10 +71,10 @@ def PermissionsFieldRenderer(permissions, *args, **kwargs):
html += tags.hidden(self.name, value='') # ugly hack..or good idea? html += tags.hidden(self.name, value='') # ugly hack..or good idea?
else: else:
html = '' html = ''
for groupkey in sorted(permissions, key=lambda k: permissions[k]['label']): for groupkey in sorted(permissions, key=lambda k: permissions[k]['label'].lower()):
inner = HTML.tag('p', c=permissions[groupkey]['label']) inner = HTML.tag('p', c=permissions[groupkey]['label'])
perms = permissions[groupkey]['perms'] perms = permissions[groupkey]['perms']
for key in sorted(perms, key=lambda p: perms[p]['label']): for key in sorted(perms, key=lambda p: perms[p]['label'].lower()):
checked = has_permission(Session(), role, key, include_guest=False) checked = has_permission(Session(), role, key, include_guest=False)
label = perms[key]['label'] label = perms[key]['label']
if readonly: if readonly: