Skip to content

Commit f8853fa

Browse files
committed
Change newlines to commas in to contacts for new liaison email notification. Fixes issue 2525. Commit ready for merge.
- Legacy-Id: 15356
1 parent c7a9c2f commit f8853fa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ietf/liaisons/forms.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,22 @@ def clean_from_contact(self):
276276
raise forms.ValidationError('Email address does not exist')
277277
return email
278278

279+
# Note to future person: This is the wrong place to fix the new lines
280+
# in cc_contacts and to_contacts. Those belong in the save function.
281+
# Or at least somewhere other than here.
279282
def clean_cc_contacts(self):
280283
'''Return a comma separated list of addresses'''
281284
cc_contacts = self.cleaned_data.get('cc_contacts')
282285
cc_contacts = cc_contacts.replace('\r\n',',')
283286
cc_contacts = cc_contacts.rstrip(',')
284287
return cc_contacts
288+
## to_contacts can also have new lines
289+
def clean_to_contacts(self):
290+
'''Return a comma separated list of addresses'''
291+
to_contacts = self.cleaned_data.get('to_contacts')
292+
to_contacts = to_contacts.replace('\r\n',',')
293+
to_contacts = to_contacts.rstrip(',')
294+
return to_contacts
285295

286296
def clean(self):
287297
if not self.cleaned_data.get('body', None) and not self.has_attachments():

0 commit comments

Comments
 (0)