Skip to content

Commit e775af3

Browse files
rjsparksNGPixel
andauthored
feat: editable wglc messages (#9607) (#9616)
* feat: editable wglc messages (#9607) * feat: split complex actions out of change state view * feat: allow editing call for adoption messages (#9702) * feat: (WIP) sketch of workflow changes to allow editing call for adoption message * feat: improved tests and related code adjustments * feat: improve the change state interstitial workflow * fix: simplify call for adoption workflow (#9964) * fix: simplify call for adoption workflow * fix: guard against nonwg target groups * refactor: make reject conditions easier to understand * feat: add issuewglc form automatic date replacement (#9969) * fix: add date adjusting js to the wglc email form (#9976) * fix: populate and use cfa and wglc forms correctly (#9981) * fix: populate cfa form correctly. use cfa form for email. * fix: restrict wglc to drafts * fix: use wglc form for email. * fix: tweak wording on forms and email (#9998) * fix: adjust when call for adoption is shown, allow direct setting of c-adopt and wg-lc (#10051) * fix: adjust when to show the call for adoption button * fix: allow direct setting of c-adopt and wg-lc * fix: adjust call for adoption wording (#10076) --------- Co-authored-by: Nicolas Giard <github@ngpixel.com>
1 parent 9a4ad72 commit e775af3

15 files changed

+1066
-192
lines changed

ietf/doc/mails.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -103,61 +103,6 @@ def email_stream_changed(request, doc, old_stream, new_stream, text=""):
103103
dict(text=text,
104104
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()),
105105
cc=cc)
106-
107-
def email_wg_call_for_adoption_issued(request, doc, cfa_duration_weeks=None):
108-
if cfa_duration_weeks is None:
109-
cfa_duration_weeks=2
110-
(to, cc) = gather_address_lists("doc_wg_call_for_adoption_issued", doc=doc)
111-
frm = request.user.person.formatted_email()
112-
113-
end_date = date_today(DEADLINE_TZINFO) + datetime.timedelta(days=7 * cfa_duration_weeks)
114-
115-
subject = f"Call for adoption: {doc.name}-{doc.rev} (Ends {end_date})"
116-
117-
send_mail(
118-
request,
119-
to,
120-
frm,
121-
subject,
122-
"doc/mail/wg_call_for_adoption_issued.txt",
123-
dict(
124-
doc=doc,
125-
subject=subject,
126-
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
127-
end_date=end_date,
128-
cfa_duration_weeks=cfa_duration_weeks,
129-
wg_list=doc.group.list_email,
130-
),
131-
cc=cc,
132-
)
133-
134-
135-
def email_wg_last_call_issued(request, doc, wglc_duration_weeks=None):
136-
if wglc_duration_weeks is None:
137-
wglc_duration_weeks = 2
138-
(to, cc) = gather_address_lists("doc_wg_last_call_issued", doc=doc)
139-
frm = request.user.person.formatted_email()
140-
141-
142-
end_date = date_today(DEADLINE_TZINFO) + datetime.timedelta(days=7 * wglc_duration_weeks)
143-
subject = f"WG Last Call: {doc.name}-{doc.rev} (Ends {end_date})"
144-
145-
send_mail(
146-
request,
147-
to,
148-
frm,
149-
subject,
150-
"doc/mail/wg_last_call_issued.txt",
151-
dict(
152-
doc=doc,
153-
subject=subject,
154-
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
155-
end_date=end_date,
156-
wglc_duration_weeks=wglc_duration_weeks,
157-
wg_list=doc.group.list_email,
158-
),
159-
cc=cc,
160-
)
161106

162107
def email_pulled_from_rfc_queue(request, doc, comment, prev_state, next_state):
163108
extra=extra_automation_headers(doc)

ietf/doc/templatetags/ietf_filters.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,3 +1017,61 @@ def is_in_stream(doc):
10171017
elif stream == "editorial":
10181018
return True
10191019
return False
1020+
1021+
1022+
@register.filter
1023+
def is_doc_ietf_adoptable(doc):
1024+
return doc.stream_id is None or all(
1025+
[
1026+
doc.stream_id == "ietf",
1027+
doc.get_state_slug("draft-stream-ietf")
1028+
not in [
1029+
"c-adopt",
1030+
"adopt-wg",
1031+
"info",
1032+
"wg-doc",
1033+
"parked",
1034+
"dead",
1035+
"wg-lc",
1036+
"waiting-for-implementation",
1037+
"chair-w",
1038+
"writeupw",
1039+
"sub-pub",
1040+
],
1041+
doc.get_state_slug("draft") != "rfc",
1042+
doc.became_rfc() is None,
1043+
]
1044+
)
1045+
1046+
1047+
@register.filter
1048+
def can_issue_ietf_wg_lc(doc):
1049+
return all(
1050+
[
1051+
doc.stream_id == "ietf",
1052+
doc.get_state_slug("draft-stream-ietf")
1053+
not in ["wg-cand", "c-adopt", "wg-lc"],
1054+
doc.get_state_slug("draft") != "rfc",
1055+
doc.became_rfc() is None,
1056+
]
1057+
)
1058+
1059+
1060+
@register.filter
1061+
def can_submit_to_iesg(doc):
1062+
return all(
1063+
[
1064+
doc.stream_id == "ietf",
1065+
doc.get_state_slug("draft-iesg") == "idexists",
1066+
doc.get_state_slug("draft-stream-ietf") not in ["wg-cand", "c-adopt"],
1067+
]
1068+
)
1069+
1070+
1071+
@register.filter
1072+
def has_had_ietf_wg_lc(doc):
1073+
return (
1074+
doc.stream_id == "ietf"
1075+
and doc.docevent_set.filter(statedocevent__state__slug="wg-lc").exists()
1076+
)
1077+

0 commit comments

Comments
 (0)