Skip to content

Commit d7c6d28

Browse files
committed
Add comment to history for multi-document ballots to compensate for the lack of support for those in the new schema
- Legacy-Id: 2755
1 parent 145fa55 commit d7c6d28

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

ietf/idrfc/views_doc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from django.utils import simplejson as json
4242
from django.utils.decorators import decorator_from_middleware
4343
from django.middleware.gzip import GZipMiddleware
44+
from django.core.urlresolvers import reverse as urlreverse
4445

4546
from ietf import settings
4647
from ietf.idtracker.models import InternetDraft, IDInternal, BallotInfo, DocumentComment
@@ -158,6 +159,12 @@ def _get_history(doc, versions):
158159
if int(e.newrevision.rev) != 0:
159160
e.desc += ' (<a href="http://tools.ietf.org/rfcdiff?url2=%s">diff from -%02d</a>)' % (filename, int(e.newrevision.rev) - 1)
160161
info["dontmolest"] = True
162+
163+
multiset_ballot_text = "This was part of a ballot set with: "
164+
if e.desc.startswith(multiset_ballot_text):
165+
names = e.desc[len(multiset_ballot_text):].split(", ")
166+
e.desc = multiset_ballot_text + ", ".join(u'<a href="%s">%s</a>' % (urlreverse("doc_view", kwargs={'name': n }), n) for n in names)
167+
info["dontmolest"] = True
161168

162169
info['text'] = e.desc
163170
info['by'] = e.by.get_name()

redesign/import-document-state.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,15 @@ def import_from_idinternal(d, idinternal):
739739
e.desc = "Ballot writeup text was added"
740740
e.save()
741741

742+
ballot_set = idinternal.ballot_set()
743+
if len(ballot_set) > 1:
744+
others = sorted(b.draft.filename for b in ballot_set if b != idinternal)
745+
desc = u"This was part of a ballot set with: %s" % ",".join(others)
746+
e, _ = Event.objects.get_or_create(type="added_comment", doc=d, desc=desc)
747+
e.time = made_up_date
748+
e.by = system_email
749+
e.save()
750+
742751
# fix tags
743752
sync_tag(d, idinternal.via_rfc_editor, tag_via_rfc_editor)
744753

@@ -759,7 +768,7 @@ def import_from_idinternal(d, idinternal):
759768
all_drafts = all_drafts.filter(filename=document_name_to_import)
760769
#all_drafts = all_drafts[all_drafts.count() - 1000:]
761770
#all_drafts = all_drafts.none()
762-
771+
763772
for index, o in enumerate(all_drafts.iterator()):
764773
print "importing", o.filename, index
765774

0 commit comments

Comments
 (0)