@@ -30,13 +30,12 @@ def email_state_changed(request, doc, text):
3030
3131def email_stream_changed (request , doc , old_stream , new_stream , text = "" ):
3232 """Email the change text to the notify group and to the stream chairs"""
33- to = [x .strip () for x in doc .notify .replace (';' , ',' ).split (',' )]
34-
35- # These use comprehension to deal with conditions when there might be more than one chair listed for a stream
33+ streams = []
3634 if old_stream :
37- to . extend ([ r . formatted_email () for r in Role . objects . filter ( group__acronym = old_stream .slug , name = 'chair' )] )
35+ streams . append ( old_stream .slug )
3836 if new_stream :
39- to .extend ([r .formatted_email () for r in Role .objects .filter (group__acronym = new_stream .slug , name = 'chair' )])
37+ streams .append (new_stream .slug )
38+ to = gather_addresses ('doc_stream_changed' ,doc = doc ,streams = streams )
4039
4140 if not to :
4241 return
@@ -124,8 +123,8 @@ def generate_last_call_announcement(request, doc):
124123 dict (doc = doc ,
125124 doc_url = settings .IDTRACKER_BASE_URL + doc .get_absolute_url () + "ballot/" ,
126125 expiration_date = expiration_date .strftime ("%Y-%m-%d" ), #.strftime("%B %-d, %Y"),
127- to = ", \n " . join ( gather_addresses ('last_call_issued' ,doc = doc ) ),
128- cc = ", \n " . join ( gather_addresses ('last_call_issued_cc' ,doc = doc ) ),
126+ to = gather_addresses ('last_call_issued' ,doc = doc ),
127+ cc = gather_addresses ('last_call_issued_cc' ,doc = doc ),
129128 group = group ,
130129 docs = [ doc ],
131130 urls = [ settings .IDTRACKER_BASE_URL + doc .get_absolute_url () ],
@@ -169,9 +168,6 @@ def generate_approval_mail_approved(request, doc):
169168 else :
170169 action_type = "Document"
171170
172- to = gather_addresses ('ballot_approved_ietf_stream' ,doc = doc )
173- cc = gather_addresses ('ballot_approved_ietf_stream_cc' ,doc = doc )
174-
175171 # the second check catches some area working groups (like
176172 # Transport Area Working Group)
177173 if doc .group .type_id not in ("area" , "individ" , "ag" ) and not doc .group .name .endswith ("Working Group" ):
@@ -202,8 +198,8 @@ def generate_approval_mail_approved(request, doc):
202198 dict (doc = doc ,
203199 docs = [doc ],
204200 doc_url = settings .IDTRACKER_BASE_URL + doc .get_absolute_url (),
205- to = ", \n " . join ( to ),
206- cc = ", \n " . join ( cc ),
201+ to = gather_addresses ( 'ballot_approved_ietf_stream' , doc = doc ),
202+ cc = gather_addresses ( 'ballot_approved_ietf_stream_cc' , doc = doc ),
207203 doc_type = doc_type ,
208204 made_by = made_by ,
209205 contacts = contacts ,
@@ -215,16 +211,13 @@ def generate_approval_mail_rfc_editor(request, doc):
215211 disapproved = doc .get_state_slug ("draft-iesg" ) in DO_NOT_PUBLISH_IESG_STATES
216212 doc_type = "RFC" if doc .get_state_slug () == "rfc" else "Internet Draft"
217213
218- to = gather_addresses ('ballot_approved_conflrev' , doc = doc )
219- cc = gather_addresses ('ballot_approved_conflrev_cc' , doc = doc )
220-
221214 return render_to_string ("doc/mail/approval_mail_rfc_editor.txt" ,
222215 dict (doc = doc ,
223216 doc_url = settings .IDTRACKER_BASE_URL + doc .get_absolute_url (),
224217 doc_type = doc_type ,
225218 disapproved = disapproved ,
226- to = ", \n " . join ( to ),
227- cc = ", \n " . join ( cc ),
219+ to = gather_addresses ( 'ballot_approved_conflrev' , doc = doc ),
220+ cc = gather_addresses ( 'ballot_approved_conflrev_cc' , doc = doc ),
228221 )
229222 )
230223
0 commit comments