Skip to content

Commit 086816c

Browse files
lnt: fix sorting requirement on int
Change-Id: I30015a13ea58deac89ceed072440beaa6283b64e
1 parent d5f000d commit 086816c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lnt/server/ui/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ def ts_data(ts):
197197
baseline_id = flask.session.get(baseline_key(ts.name))
198198
# Sorted baselines by llvm_project_revision in ascending order.
199199
baselines = request.session.query(ts.Baseline).all()
200-
baselines.sort(key=lambda b: int(b.order.llvm_project_revision))
200+
# First try numerically, then lexicographically
201+
try:
202+
baselines.sort(key=lambda b: float(b.order.llvm_project_revision))
203+
except:
204+
baselines.sort(key=lambda b: b.order.llvm_project_revision)
201205
return {
202206
'baseline_id': baseline_id,
203207
'baselines': baselines,

0 commit comments

Comments
 (0)