Skip to content

Commit a885c85

Browse files
committed
Merged in [13292] from rcross@amsl.com:
Fixes ietf-tools#2002. Trailing comma in Liaison cc_contacts field causes invalid email address error. - Legacy-Id: 13315 Note: SVN reference [13292] has been migrated to Git commit 9972a54
2 parents 3ee897d + 9972a54 commit a885c85

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ietf/liaisons/forms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def validate_emails(value):
102102
value = value.strip() # strip whitespace
103103
if '\r\n' in value: # cc_contacts has newlines
104104
value = value.replace('\r\n',',')
105+
value = value.rstrip(',') # strip trailing comma
105106
emails = value.split(',')
106107
for email in emails:
107108
name, addr = parseaddr(email)
@@ -277,7 +278,9 @@ def clean_from_contact(self):
277278
def clean_cc_contacts(self):
278279
'''Return a comma separated list of addresses'''
279280
cc_contacts = self.cleaned_data.get('cc_contacts')
280-
return cc_contacts.replace('\r\n',',')
281+
cc_contacts = cc_contacts.replace('\r\n',',')
282+
cc_contacts = cc_contacts.rstrip(',')
283+
return cc_contacts
281284

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

0 commit comments

Comments
 (0)