Python2/3 compatibility: Added more elements to list (tuple) entries to ensure sorting without exceptions under Python3.

- Legacy-Id: 16451
This commit is contained in:
Henrik Levkowetz 2019-07-15 15:51:26 +00:00
parent 831fb18f8a
commit 28472a462b

View file

@ -1,6 +1,9 @@
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import debug # pyflakes:ignore
@ -103,7 +106,7 @@ def fill_in_document_table_attributes(docs, have_telechat_date=False):
d.expirable = expirable_draft(d)
if d.get_state_slug() != "rfc":
d.milestones = [ m for (t, m) in sorted(((m.time, m) for m in d.groupmilestone_set.all() if m.state_id == "active")) ]
d.milestones = [ m for (t, s, d, m) in sorted(((m.time, m.state.slug, m.desc, m) for m in d.groupmilestone_set.all() if m.state_id == "active")) ]
d.reviewed_by_teams = sorted(set(r.team.acronym for r in d.reviewrequest_set.filter(state__in=["assigned","accepted","part-completed","completed"]).distinct().select_related('team')))
e = d.latest_event_cache.get('started_iesg_process', None)