Add comment to history for multi-document ballots to compensate for the lack of support for those in the new schema

- Legacy-Id: 2755
This commit is contained in:
Ole Laursen 2011-01-21 20:37:09 +00:00
parent 145fa558d4
commit d7c6d28f2e
2 changed files with 17 additions and 1 deletions

View file

@ -41,6 +41,7 @@ from django.template.defaultfilters import truncatewords_html
from django.utils import simplejson as json
from django.utils.decorators import decorator_from_middleware
from django.middleware.gzip import GZipMiddleware
from django.core.urlresolvers import reverse as urlreverse
from ietf import settings
from ietf.idtracker.models import InternetDraft, IDInternal, BallotInfo, DocumentComment
@ -158,6 +159,12 @@ def _get_history(doc, versions):
if int(e.newrevision.rev) != 0:
e.desc += ' (<a href="http://tools.ietf.org/rfcdiff?url2=%s">diff from -%02d</a>)' % (filename, int(e.newrevision.rev) - 1)
info["dontmolest"] = True
multiset_ballot_text = "This was part of a ballot set with: "
if e.desc.startswith(multiset_ballot_text):
names = e.desc[len(multiset_ballot_text):].split(", ")
e.desc = multiset_ballot_text + ", ".join(u'<a href="%s">%s</a>' % (urlreverse("doc_view", kwargs={'name': n }), n) for n in names)
info["dontmolest"] = True
info['text'] = e.desc
info['by'] = e.by.get_name()

View file

@ -739,6 +739,15 @@ def import_from_idinternal(d, idinternal):
e.desc = "Ballot writeup text was added"
e.save()
ballot_set = idinternal.ballot_set()
if len(ballot_set) > 1:
others = sorted(b.draft.filename for b in ballot_set if b != idinternal)
desc = u"This was part of a ballot set with: %s" % ",".join(others)
e, _ = Event.objects.get_or_create(type="added_comment", doc=d, desc=desc)
e.time = made_up_date
e.by = system_email
e.save()
# fix tags
sync_tag(d, idinternal.via_rfc_editor, tag_via_rfc_editor)
@ -759,7 +768,7 @@ if document_name_to_import:
all_drafts = all_drafts.filter(filename=document_name_to_import)
#all_drafts = all_drafts[all_drafts.count() - 1000:]
#all_drafts = all_drafts.none()
for index, o in enumerate(all_drafts.iterator()):
print "importing", o.filename, index