|
10 | 10 |
|
11 | 11 | from ietf.utils.mail import send_mail, send_mail_text |
12 | 12 | from ietf.ipr.utils import iprs_from_docs, related_docs |
13 | | -from ietf.doc.models import WriteupDocEvent, BallotPositionDocEvent, LastCallDocEvent, DocAlias, ConsensusDocEvent |
| 13 | +from ietf.doc.models import WriteupDocEvent, LastCallDocEvent, DocAlias, ConsensusDocEvent |
14 | 14 | from ietf.doc.utils import needed_ballot_positions, get_document_content |
15 | | -from ietf.person.models import Person |
16 | 15 | from ietf.group.models import Role |
17 | 16 | from ietf.doc.models import Document |
18 | 17 | from ietf.mailtoken.utils import gather_address_lists |
@@ -308,66 +307,14 @@ def email_ballot_undeferred(request, doc, by, telechat_date): |
308 | 307 | cc=cc) |
309 | 308 |
|
310 | 309 | def generate_issue_ballot_mail(request, doc, ballot): |
311 | | - active_ads = Person.objects.filter(role__name="ad", role__group__state="active", role__group__type="area").distinct() |
312 | 310 |
|
313 | | - positions = BallotPositionDocEvent.objects.filter(doc=doc, type="changed_ballot_position", ballot=ballot).order_by("-time", '-id').select_related('ad') |
314 | | - |
315 | | - # format positions and setup discusses and comments |
316 | | - ad_feedback = [] |
317 | | - seen = set() |
318 | | - active_ad_positions = [] |
319 | | - inactive_ad_positions = [] |
320 | | - for p in positions: |
321 | | - if p.ad in seen: |
322 | | - continue |
323 | | - |
324 | | - seen.add(p.ad) |
325 | | - |
326 | | - def formatted(val): |
327 | | - if val: |
328 | | - return "[ X ]" |
329 | | - else: |
330 | | - return "[ ]" |
331 | | - |
332 | | - fmt = u"%-21s%-10s%-11s%-9s%-10s" % ( |
333 | | - p.ad.plain_name()[:21], |
334 | | - formatted(p.pos_id == "yes"), |
335 | | - formatted(p.pos_id == "noobj"), |
336 | | - formatted(p.pos_id == "discuss"), |
337 | | - "[ R ]" if p.pos_id == "recuse" else formatted(p.pos_id == "abstain"), |
338 | | - ) |
339 | | - |
340 | | - if p.ad in active_ads: |
341 | | - active_ad_positions.append(fmt) |
342 | | - if not p.pos_id == "discuss": |
343 | | - p.discuss = "" |
344 | | - if p.comment or p.discuss: |
345 | | - ad_feedback.append(p) |
346 | | - else: |
347 | | - inactive_ad_positions.append(fmt) |
348 | | - |
349 | | - active_ad_positions.sort() |
350 | | - inactive_ad_positions.sort() |
351 | | - ad_feedback.sort(key=lambda p: p.ad.plain_name()) |
352 | | - |
353 | 311 | e = doc.latest_event(LastCallDocEvent, type="sent_last_call") |
354 | 312 | last_call_expires = e.expires if e else None |
355 | 313 |
|
356 | | - e = doc.latest_event(WriteupDocEvent, type="changed_ballot_approval_text") |
357 | | - approval_text = e.text if e else "" |
358 | | - |
359 | | - e = doc.latest_event(WriteupDocEvent, type="changed_ballot_writeup_text") |
360 | | - ballot_writeup = e.text if e else "" |
361 | | - |
362 | 314 | return render_to_string("doc/mail/issue_ballot_mail.txt", |
363 | 315 | dict(doc=doc, |
364 | 316 | doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(), |
365 | | - active_ad_positions=active_ad_positions, |
366 | | - inactive_ad_positions=inactive_ad_positions, |
367 | | - ad_feedback=ad_feedback, |
368 | 317 | last_call_expires=last_call_expires, |
369 | | - approval_text=approval_text, |
370 | | - ballot_writeup=ballot_writeup, |
371 | 318 | needed_ballot_positions= |
372 | 319 | needed_ballot_positions(doc, |
373 | 320 | doc.active_ballot().active_ad_positions().values() |
|
0 commit comments