File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ():
You can’t perform that action at this time.
0 commit comments