Skip to content

Commit 5eeb670

Browse files
committed
Merged [4909] from rjsparks@nostrum.com:
Reimplemented clear_ballot to close the existing ballot and create a new one. Changed the all_positions code to only return synthetic no-positions for current ADs when a ballot is actually open - Legacy-Id: 4962 Note: SVN reference [4909] has been migrated to Git commit 2e6caa2
2 parents 9d042ba + 2e6caa2 commit 5eeb670

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

ietf/doc/models.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,16 @@ def all_positions(self):
567567
latest.old_positions.append(e.pos)
568568

569569
# add any missing ADs through fake No Record events
570-
norecord = BallotPositionName.objects.get(slug="norecord")
571-
for ad in active_ads:
572-
if ad not in seen:
573-
e = BallotPositionDocEvent(type="changed_ballot_position", doc=self.doc, ad=ad)
574-
e.pos = norecord
575-
e.old_ad = False
576-
e.old_positions = []
577-
positions.append(e)
570+
if self.doc.active_ballot() == self:
571+
norecord = BallotPositionName.objects.get(slug="norecord")
572+
for ad in active_ads:
573+
if ad not in seen:
574+
e = BallotPositionDocEvent(type="changed_ballot_position", doc=self.doc, ad=ad)
575+
e.by = ad
576+
e.pos = norecord
577+
e.old_ad = False
578+
e.old_positions = []
579+
positions.append(e)
578580

579581
positions.sort(key=lambda p: (p.old_ad, p.ad.last_name()))
580582
return positions

ietf/idrfc/views_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def document_ballot_content(request, doc, ballot_id, editable=True):
296296

297297
deferred = doc.active_defer_event()
298298

299-
positions = doc.active_ballot().all_positions() if doc.active_ballot() else ballot.all_positions()
299+
positions = ballot.all_positions()
300300

301301
# put into position groups
302302
position_groups = []

0 commit comments

Comments
 (0)