misc: use key= in sort() calls (#31357)

This commit is contained in:
Frédéric Péters 2019-03-13 14:38:10 +01:00
parent 03a2aa8ed4
commit 304348505f
2 changed files with 2 additions and 2 deletions

View File

@ -318,7 +318,7 @@ class Authentic(FileBaseSettingsLoader):
fields = hobo_json.get('profile', {}).get('fields')
if fields:
fields.sort(lambda x, y: cmp(x.get('order'), y.get('order')))
fields.sort(key=lambda : x.get('order'))
fields = [x for x in fields if not x['disabled']]
tenant_settings.A2_PROFILE_FIELDS = [x['name'] for x in fields]
tenant_settings.A2_REQUIRED_FIELDS = [

View File

@ -35,7 +35,7 @@ def get_themes():
if not 'module' in theme:
theme['module'] = dirname
themes.append(theme)
themes.sort(lambda x, y: cmp(x.get('label'), y.get('label')))
themes.sort(key=lambda x: x.get('label'))
return themes
def get_selected_theme():