diff options
author | Magnus Hagander | 2019-08-01 11:16:55 +0000 |
---|---|---|
committer | Magnus Hagander | 2019-08-07 08:46:38 +0000 |
commit | 0320af16f24cebcf7361cc9b6538a373348476a2 (patch) | |
tree | 6e16a547fe4c40e5bf5fb473e1a8e85628a97ba6 /tools/deploystatic/deploystatic.py | |
parent | c98765072dc2e0e1c0eef57d1877b4c9fe394b32 (diff) |
Default groupby_sort order to 0 instead of None
In all our uses groupby_sort is used on an integer, and as of Python3
one cannot compare an integer and None (a very reasonable change). This
worked on Python2 more or less by mistake.
This fixes session list view in cases where there exists approved
sessions without tracks.
Diffstat (limited to 'tools/deploystatic/deploystatic.py')
-rwxr-xr-x | tools/deploystatic/deploystatic.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/deploystatic/deploystatic.py b/tools/deploystatic/deploystatic.py index 2ea1e417..37667b10 100755 --- a/tools/deploystatic/deploystatic.py +++ b/tools/deploystatic/deploystatic.py @@ -34,7 +34,7 @@ import dateutil.parser # attributes on the grouped objects. def filter_groupby_sort(objects, keyfield, sortkey): group = [(key, list(group)) for key, group in groupby(objects, lambda x: getattr(x, keyfield))] - return sorted(group, key=lambda y: y[0] and getattr(y[0], sortkey) or None) + return sorted(group, key=lambda y: y[0] and getattr(y[0], sortkey) or 0) # Shuffle the order in a list, for example to randomize the order of sponsors |