From 5d1053e89d904621034a3bed975d9bc5ede804fa Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 12 Sep 2018 22:33:59 +0200 Subject: [PATCH] Reverse order of upcoming and current conferences on dashboard Show the next upcoming one first, instead of ordering them last-to-first. This makes more sense for current/upcoming, since the one most likely to be worked on is then at the first position. Past conferences remain sorted the same way as before, since that leaves the most recent one first. Suggsted by Andreas Scherbaum, though not his patch since it didn't work. --- postgresqleu/confreg/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py index 1638780..e80fb11 100644 --- a/postgresqleu/confreg/views.py +++ b/postgresqleu/confreg/views.py @@ -2468,9 +2468,9 @@ def admin_dashboard(request): past = [] for c in conferences: if abs((date.today() - c.startdate).days) < 14 or abs((date.today() - c.enddate).days) < 14: - current.append(c) + current.insert(0, c) elif c.startdate > date.today(): - upcoming.append(c) + upcoming.insert(0, c) else: past.append(c) -- 2.39.5