Skip to content

Commit 6062e16

Browse files
committed
Email IANA and RFC Editor when a draft is pulled from the queue at the
Datatracker, add page for editing IANA states, add more info to the /doc/draft-XXXXX/doc.json dump for the RFC Editor, add page for editing consensus, add page for requesting publication at the RFC Editor for alternate streams (this will email the RFC Editor and set the draft in the appropriate state), make it possible for alternate streams to change the intended RFC status of a draft in the stream, refactor how IANA copies are handled slightly so it's less code, put drafts automatically in IANA Review "Need Review" state upon last call, fix a bug in ballot issuing, remove a bit of dead code - Legacy-Id: 4857
1 parent 5c89b8a commit 6062e16

22 files changed

Lines changed: 740 additions & 514 deletions

ietf/idrfc/mails.py

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,26 @@ def email_stream_changed(request, doc, old_stream, new_stream, text=""):
6262
"idrfc/stream_changed_email.txt",
6363
dict(text=text,
6464
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()))
65+
66+
def email_pulled_from_rfc_queue(request, doc, comment, prev_state, next_state):
67+
send_mail(request, ['IANA <iana@iana.org>', 'rfc-editor@rfc-editor.org'], None,
68+
"%s changed state from %s to %s" % (doc.name, prev_state.name, next_state.name),
69+
"idrfc/pulled_from_rfc_queue_email.txt",
70+
dict(doc=doc,
71+
prev_state=prev_state,
72+
next_state=next_state,
73+
comment=comment,
74+
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
75+
extra=extra_automation_headers(doc))
76+
77+
78+
def email_authors(request, doc, subject, text):
79+
to = [x.strip() for x in doc.author_list().split(',')]
80+
if not to:
81+
return
6582

66-
83+
send_mail_text(request, to, None, subject, text)
84+
6785
def html_to_text(html):
6886
return strip_tags(html.replace("&lt;", "<").replace("&gt;", ">").replace("&amp;", "&").replace("<br>", "\n"))
6987

@@ -98,12 +116,15 @@ def email_adREDESIGN(request, doc, ad, changed_by, text, subject=None):
98116

99117

100118
def generate_ballot_writeup(request, doc):
119+
e = doc.latest_event(type="iana_review")
120+
iana = e.desc if e else ""
121+
101122
e = WriteupDocEvent()
102123
e.type = "changed_ballot_writeup_text"
103124
e.by = request.user.get_profile()
104125
e.doc = doc
105126
e.desc = u"Ballot writeup was generated"
106-
e.text = unicode(render_to_string("idrfc/ballot_writeup.txt"))
127+
e.text = unicode(render_to_string("idrfc/ballot_writeup.txt", {'iana': iana}))
107128
e.save()
108129

109130
return e
@@ -263,6 +284,20 @@ def generate_approval_mail_rfc_editorREDESIGN(request, doc):
263284
generate_approval_mail = generate_approval_mailREDESIGN
264285
generate_approval_mail_rfc_editor = generate_approval_mail_rfc_editorREDESIGN
265286

287+
def generate_publication_request(request, doc):
288+
group_description = ""
289+
if doc.group and doc.group.acronym != "none":
290+
group_description = doc.group.name
291+
if doc.group.type_id in ("wg", "rg", "area"):
292+
group_description += " %s (%s)" % (doc.group.type, doc.group.acronym)
293+
294+
295+
return render_to_string("idrfc/publication_request.txt",
296+
dict(doc=doc,
297+
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
298+
group_description=group_description,
299+
)
300+
)
266301

267302
def send_last_call_request(request, doc, ballot):
268303
to = "iesg-secretary@ietf.org"
@@ -425,39 +460,13 @@ def formatted(val):
425460
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
426461
generate_issue_ballot_mail = generate_issue_ballot_mailREDESIGN
427462

428-
def email_iana(request, doc, to, msg):
429-
# fix up message and send message to IANA for each in ballot set
430-
import email
431-
parsed_msg = email.message_from_string(msg.encode("utf-8"))
432-
433-
for i in doc.idinternal.ballot_set():
434-
extra = {}
435-
extra["Reply-To"] = "noreply@ietf.org"
436-
extra["X-IETF-Draft-string"] = i.document().filename
437-
extra["X-IETF-Draft-revision"] = i.document().revision_display()
438-
439-
send_mail_text(request, "To: IANA <%s>" % to,
440-
parsed_msg["From"], parsed_msg["Subject"],
441-
parsed_msg.get_payload(),
442-
extra=extra)
443-
444-
def email_ianaREDESIGN(request, doc, to, msg):
445-
# fix up message and send it with extra info on doc in headers
446-
import email
447-
parsed_msg = email.message_from_string(msg.encode("utf-8"))
448-
463+
def extra_automation_headers(doc):
449464
extra = {}
450465
extra["Reply-To"] = "noreply@ietf.org"
451466
extra["X-IETF-Draft-string"] = doc.name
452467
extra["X-IETF-Draft-revision"] = doc.rev
453-
454-
send_mail_text(request, "IANA <%s>" % to,
455-
parsed_msg["From"], parsed_msg["Subject"],
456-
parsed_msg.get_payload(),
457-
extra=extra)
458468

459-
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
460-
email_iana = email_ianaREDESIGN
469+
return extra
461470

462471
def email_last_call_expired(doc):
463472
text = "IETF Last Call has ended, and the state has been changed to\n%s." % doc.idinternal.cur_state.state

0 commit comments

Comments
 (0)