From 5fa8d713035f2bceb1801441db6f61bd8ecdb1b6 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Fri, 20 Jan 2012 14:21:24 +0000 Subject: [PATCH] Autogenerate approval text if it's not there rather than requiring it to be generated (noticed by Robert Sparks) - Legacy-Id: 3836 --- ietf/idrfc/testsREDESIGN.py | 10 +--------- ietf/idrfc/views_ballot.py | 9 +++++---- ietf/templates/idrfc/ballot_writeupnotesREDESIGN.html | 4 +--- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/ietf/idrfc/testsREDESIGN.py b/ietf/idrfc/testsREDESIGN.py index da73ef7c3..08023491e 100644 --- a/ietf/idrfc/testsREDESIGN.py +++ b/ietf/idrfc/testsREDESIGN.py @@ -674,14 +674,6 @@ class BallotWriteupsTestCase(django.test.TestCase): # inactive create_pos(9, "yes") - # we need approval text to be able to submit - e = WriteupDocEvent() - e.doc = draft - e.by = Person.objects.get(name="Aread Irector") - e.type = "changed_ballot_approval_text" - e.text = "The document has been approved." - e.save() - mailbox_before = len(outbox) r = self.client.post(url, dict( @@ -699,7 +691,7 @@ class BallotWriteupsTestCase(django.test.TestCase): self.assertTrue("comment3" in str(issue_email)) self.assertTrue("discuss3" in str(issue_email)) self.assertTrue("This is a test" in str(issue_email)) - self.assertTrue("The document has been approved" in str(issue_email)) + self.assertTrue("The IESG has approved" in str(issue_email)) def test_edit_approval_text(self): draft = make_test_data() diff --git a/ietf/idrfc/views_ballot.py b/ietf/idrfc/views_ballot.py index a7d53b3dc..b0c603f99 100644 --- a/ietf/idrfc/views_ballot.py +++ b/ietf/idrfc/views_ballot.py @@ -932,8 +932,6 @@ def ballot_writeupnotesREDESIGN(request, name): login = request.user.get_profile() - approval = doc.latest_event(WriteupDocEvent, type="changed_ballot_approval_text") - existing = doc.latest_event(WriteupDocEvent, type="changed_ballot_writeup_text") if not existing: existing = generate_ballot_writeup(request, doc) @@ -952,7 +950,7 @@ def ballot_writeupnotesREDESIGN(request, name): e.text = t e.save() - if "issue_ballot" in request.POST and approval: + if "issue_ballot" in request.POST: if has_role(request.user, "Area Director") and not doc.latest_event(BallotPositionDocEvent, ad=login, time__gte=started_process.time): # sending the ballot counts as a yes pos = BallotPositionDocEvent(doc=doc, by=login) @@ -962,6 +960,10 @@ def ballot_writeupnotesREDESIGN(request, name): pos.desc = "[Ballot Position Update] New position, %s, has been recorded for %s" % (pos.pos.name, pos.ad.name) pos.save() + approval = doc.latest_event(WriteupDocEvent, type="changed_ballot_approval_text") + if not approval: + approval = generate_approval_mail(request, doc) + msg = generate_issue_ballot_mail(request, doc) send_mail_preformatted(request, msg) @@ -989,7 +991,6 @@ def ballot_writeupnotesREDESIGN(request, name): ballot_issued=bool(doc.latest_event(type="sent_ballot_announcement")), ballot_writeup_form=form, need_intended_status=need_intended_status, - approval=approval, ), context_instance=RequestContext(request)) diff --git a/ietf/templates/idrfc/ballot_writeupnotesREDESIGN.html b/ietf/templates/idrfc/ballot_writeupnotesREDESIGN.html index 3cab31e74..a69769444 100644 --- a/ietf/templates/idrfc/ballot_writeupnotesREDESIGN.html +++ b/ietf/templates/idrfc/ballot_writeupnotesREDESIGN.html @@ -23,12 +23,10 @@ form #id_ballot_writeup { {{ ballot_writeup_form.ballot_writeup }} - {% if not approval %}

Ballot cannot be issued before announcement text is added.

{% endif %} -
Back - +