From c92281f815f603bf33fc89faf5062542ab965b15 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 15 Jul 2021 20:34:23 +0000 Subject: [PATCH] Merged in [19208] from housley@vigilsec.com: Provide previous ballot positions for both current and former ADs; add test to cover this situation. - Legacy-Id: 19230 Note: SVN reference [19208] has been migrated to Git commit fa37d3db3fad007686165a6ed4ad4c99cfca2c85 --- ietf/doc/tests.py | 19 ++++++++++++++++++- .../doc/document_ballot_content.html | 4 +++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index e8fa33891..acd7e3007 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -1529,7 +1529,24 @@ class DocTestCase(TestCase): r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name))) self.assertEqual(r.status_code, 200) self.assertContains(r, '(%s for -%s)' % (pos.comment_time.strftime('%Y-%m-%d'), oldrev)) - + + # Now simulate a new ballot against the new revision and make sure the "was" position is included + pos2 = BallotPositionDocEvent.objects.create( + doc=doc, + rev=doc.rev, + ballot=ballot, + type="changed_ballot_position", + pos_id="noobj", + comment="Still looks okay to me", + comment_time=datetime.datetime.now(), + balloter=Person.objects.get(user__username="ad"), + by=Person.objects.get(name="(System)")) + + r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name))) + self.assertEqual(r.status_code, 200) + self.assertContains(r, pos2.comment) + self.assertContains(r, '(was %s)' % pos.pos) + def test_document_ballot_needed_positions(self): # draft doc = IndividualDraftFactory(intended_std_level_id='ps') diff --git a/ietf/templates/doc/document_ballot_content.html b/ietf/templates/doc/document_ballot_content.html index 91a537fba..3b0cd3f49 100644 --- a/ietf/templates/doc/document_ballot_content.html +++ b/ietf/templates/doc/document_ballot_content.html @@ -74,7 +74,9 @@ {% for p in positions %} {% if not p.is_old_pos %}

{{ p.balloter.plain_name }} - {{p.pos}} + + {% if p.old_positions %}(was {{ p.old_positions|join:", " }}){% endif %} + {{p.pos}} {% if user|has_role:"Secretariat" %} Edit {% endif %}