summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-03-25 18:40:11 +0200
committerLars Wirzenius <liw@liw.fi>2016-03-25 18:40:11 +0200
commit5b2a96605e1a5aa586c2cf7d297fb4f60549918b (patch)
tree58e5c973a9356f42be45699febca610ba4336251
parentb8b2e90a1768ad7d2acb6c0c4ab207dbad87dc8b (diff)
downloaddistix-5b2a96605e1a5aa586c2cf7d297fb4f60549918b.tar.gz
Fix HTML ticket lists to be sorted by date
-rw-r--r--distixlib/plugins/html_plugin.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/distixlib/plugins/html_plugin.py b/distixlib/plugins/html_plugin.py
index 59f82a8..96b538c 100644
--- a/distixlib/plugins/html_plugin.py
+++ b/distixlib/plugins/html_plugin.py
@@ -88,11 +88,14 @@ class StaticSite(object):
def _render_ticket_list(self, template, filename, condition):
variables = {
'description_html': self._make_html(self._repo.get_description()),
- 'tickets': self._get_tickets(condition),
+ 'tickets': self._sort_tickets(self._get_tickets(condition)),
}
html = self._renderer.render(template, variables)
self._write_file(filename, html)
+ def _sort_tickets(self, tickets):
+ return sorted(tickets, key=lambda t: t.get_newest_message_timestamp())
+
def _render_ticket(self, ticket):
thread = distixlib.MessageThread()
for msg in ticket.get_messages():