summaryrefslogtreecommitdiff
path: root/tools/deploystatic/deploystatic.py
diff options
context:
space:
mode:
authorMagnus Hagander2019-08-01 11:16:55 +0000
committerMagnus Hagander2019-08-07 08:46:38 +0000
commit0320af16f24cebcf7361cc9b6538a373348476a2 (patch)
tree6e16a547fe4c40e5bf5fb473e1a8e85628a97ba6 /tools/deploystatic/deploystatic.py
parentc98765072dc2e0e1c0eef57d1877b4c9fe394b32 (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-xtools/deploystatic/deploystatic.py2
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