Changeset 16300 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 4 Nov 2020, 22:25:27 (4 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r16299 r16300 350 350 entries.sort() 351 351 deleted = [] 352 emails_tobesent = ''352 emails_tobesent = [] 353 353 for entry in entries: 354 354 if 'remove' in form: … … 356 356 deleted.append(entry) 357 357 if 'send_email' in form and self.context[entry].email: 358 emails_tobesent += '%s,' % encode_address(358 emails_tobesent.append(( 359 359 self.context[entry].email, 360 self.context[entry].student_id) 360 self.context[entry].student_id)) 361 361 if 'send_email' in form and not len(emails_tobesent): 362 362 self.flash(_('No email address found.'), type="warning") 363 363 return 364 364 if len(emails_tobesent): 365 args = {'bcc_to': emails_tobesent .strip(',')}365 args = {'bcc_to': emails_tobesent} 366 366 self.redirect(self.url(self.context) + 367 367 '/send_bulk_email?%s' % urlencode(args)) … … 570 570 self.config.name, 571 571 data['body'],data['subject'], 572 data['bcc_to']) 572 eval(data['bcc_to']) 573 ) 573 574 if success: 574 575 self.flash(_('Your message has been sent.')) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r16299 r16300 476 476 ctrl.getControl(value='K1000001').selected = True 477 477 self.browser.getControl("Send bulk", index=0).click() 478 self.assertTrue( 'K1000000 <aa@aa.ng>,K1000001 <uli@uni.ng>'478 self.assertTrue("[('aa@aa.ng', u'K1000000'), ('uli@uni.ng', u'K1000001')]" 479 479 in self.browser.contents) 480 480 self.browser.getControl(name="form.subject").value = 'Test' … … 483 483 self.assertTrue('Your message has been sent' in self.browser.contents) 484 484 self.assertMatches( 485 u'Sending email from no-reply@waeup.org to contact@waeup.org :\n'485 u'Sending email from no-reply@waeup.org to contact@waeup.org, aa@aa.ng, uli@uni.ng:\n' 486 486 u'Message:\n' 487 487 u'msg: MIME-Version: 1.0\n' … … 490 490 u'msg: From: Manager <no-reply@waeup.org>\n' 491 491 u'msg: To: Manager <contact@waeup.org>\n' 492 u'msg: Bcc: K1000000 <aa@aa.ng>,K1000001 <uli@uni.ng>\n' 492 u'msg: Bcc: K0000000 <aa@aa.ng>\n' 493 u'msg: Bcc: K0000001 <uli@uni.ng>\n' 493 494 u'msg: Reply-To: Manager <contact@waeup.org>\n' 494 495 u'msg: Subject: Test\n'
Note: See TracChangeset for help on using the changeset viewer.