Prevent page crash when using default comparer on Global Status page
When LNT was still Python 2 the default comparer was able to handle None
values with <, however Python 3 doesn't support this. As a result after
the Python 3 upgrade the Global Status page crashes when sorting any
values with None in them in the second column.
I believe this happens when there is no regression detected so this is a
valid state.
There are two ways to handle this, either filter out the None values or
sort them all the same. I have choosen the second approach since I
believe that is what Python 2 did.
Reviewed By: thopre
Differential Revision: https://reviews.llvm.org/D85422
diff --git a/lnt/server/ui/views.py b/lnt/server/ui/views.py
index 9b1418b..d119787 100644
--- a/lnt/server/ui/views.py
+++ b/lnt/server/ui/views.py
@@ -1387,7 +1387,7 @@
test_table.append(row)
# Order the table by worst regression.
- test_table.sort(key=lambda row: row[1], reverse=True)
+ test_table.sort(key=lambda row: 0 if row[1] is None else row[1], reverse=True)
return render_template("v4_global_status.html",
tests=test_table,