|
23 | 23 | from ietf.doc.lastcall import request_last_call |
24 | 24 | from ietf.iesg.models import TelechatDate |
25 | 25 | from ietf.ietfauth.utils import has_role, role_required, is_authorized_in_doc_stream |
| 26 | +from ietf.mailtrigger.utils import gather_address_lists |
| 27 | +from ietf.mailtrigger.forms import CcSelectForm |
26 | 28 | from ietf.message.utils import infer_message |
27 | 29 | from ietf.name.models import BallotPositionName |
28 | 30 | from ietf.person.models import Person |
| 31 | +from ietf.utils import log |
29 | 32 | from ietf.utils.mail import send_mail_text, send_mail_preformatted |
30 | | -from ietf.mailtrigger.utils import gather_address_lists |
31 | | -from ietf.mailtrigger.forms import CcSelectForm |
32 | 33 |
|
33 | 34 | BALLOT_CHOICES = (("yes", "Yes"), |
34 | 35 | ("noobj", "No Objection"), |
@@ -233,7 +234,6 @@ def edit_position(request, name, ballot_id): |
233 | 234 | blocking_positions=json.dumps(blocking_positions), |
234 | 235 | )) |
235 | 236 |
|
236 | | - |
237 | 237 | @role_required('Area Director','Secretariat') |
238 | 238 | def send_ballot_comment(request, name, ballot_id): |
239 | 239 | """Email document ballot position discuss/comment for Area Director.""" |
@@ -329,7 +329,7 @@ def clear_ballot(request, name): |
329 | 329 | by = request.user.person |
330 | 330 | for t in BallotType.objects.filter(doc_type=doc.type_id): |
331 | 331 | close_ballot(doc, by, t.slug) |
332 | | - create_ballot_if_not_open(doc, by, t.slug) |
| 332 | + create_ballot_if_not_open(request, doc, by, t.slug) |
333 | 333 | if doc.get_state('draft-iesg').slug == 'defer': |
334 | 334 | do_undefer_ballot(request,doc) |
335 | 335 | return redirect("ietf.doc.views_doc.document_main", name=doc.name) |
@@ -533,9 +533,9 @@ def ballot_writeupnotes(request, name): |
533 | 533 | existing.save() |
534 | 534 |
|
535 | 535 | if "issue_ballot" in request.POST: |
536 | | - create_ballot_if_not_open(doc, login, "approve") |
| 536 | + e = create_ballot_if_not_open(request, doc, login, "approve") # pyflakes:ignore |
537 | 537 | ballot = doc.latest_event(BallotDocEvent, type="created_ballot") |
538 | | - |
| 538 | + log.assertion('ballot == e') |
539 | 539 | if has_role(request.user, "Area Director") and not doc.latest_event(BallotPositionDocEvent, ad=login, ballot=ballot): |
540 | 540 | # sending the ballot counts as a yes |
541 | 541 | pos = BallotPositionDocEvent(doc=doc, rev=doc.rev, by=login) |
|
0 commit comments