From ab6a7f85c05622a748072c29d0875176f976f203 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Mon, 21 Jan 2013 11:54:56 +0000 Subject: [PATCH] Get rid of initial "No record" positions when showing old positions, it's just noise - Legacy-Id: 5312 --- ietf/doc/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index 5e43d06d6..1a4cc6f9c 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -594,7 +594,13 @@ class BallotDocEvent(DocEvent): if e.pos != prev: latest.old_positions.append(e.pos) - + + # get rid of trailling "No record" positions, some old ballots + # have plenty of these + for p in positions: + while p.old_positions and p.old_positions[-1].slug == "norecord": + p.old_positions.pop() + # add any missing ADs through fake No Record events if self.doc.active_ballot() == self: norecord = BallotPositionName.objects.get(slug="norecord")