Project

General

Profile

0001-misc-use-key-in-sort-calls-31357.patch

Frédéric Péters, 13 Mar 2019 02:38 PM

Download (1.49 KB)

View differences:

Subject: [PATCH] misc: use key= in sort() calls (#31357)

 hobo/multitenant/settings_loaders.py | 2 +-
 hobo/theme/utils.py                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hobo/multitenant/settings_loaders.py
318 318

  
319 319
        fields = hobo_json.get('profile', {}).get('fields')
320 320
        if fields:
321
            fields.sort(lambda x, y: cmp(x.get('order'), y.get('order')))
321
            fields.sort(key=lambda : x.get('order'))
322 322
            fields = [x for x in fields if not x['disabled']]
323 323
            tenant_settings.A2_PROFILE_FIELDS = [x['name'] for x in fields]
324 324
            tenant_settings.A2_REQUIRED_FIELDS = [
hobo/theme/utils.py
35 35
            if not 'module' in theme:
36 36
                theme['module'] = dirname
37 37
            themes.append(theme)
38
    themes.sort(lambda x, y: cmp(x.get('label'), y.get('label')))
38
    themes.sort(key=lambda x: x.get('label'))
39 39
    return themes
40 40

  
41 41
def get_selected_theme():
42
-