Ignore:
Timestamp:
7 Jul 2016, 06:18:06 (8 years ago)
Author:
Henrik Bettermann
Message:

Inform applicant how many emails were sent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r14014 r14016  
    11761176        ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    11771177        failed = ''
     1178        emails_sent = 0
    11781179        for referee in self.context.referees:
    11791180            if referee.email_sent:
     
    11931194            success = kofa_utils.inviteReferee(referee, self.context, url_info)
    11941195            if success:
     1196                emails_sent += 1
    11951197                self.context.writeLogMessage(
    11961198                    self, 'email sent: %s' % referee.email)
     
    11981200            else:
    11991201                failed += '%s ' % referee.email
    1200         return failed
     1202        return failed, emails_sent
    12011203
    12021204    @action(_('Finally Submit'), warning=WARNING)
     
    12181220        # Create mandates and send emails to referees
    12191221        if getattr(self.context, 'referees', None):
    1220             failed = self.informReferees()
     1222            failed, emails_sent = self.informReferees()
    12211223            if failed:
    12221224                self.flash(
     
    12251227                return
    12261228            msg = _('Form has been successfully submitted and '
    1227                     'all invitation emails were sent.')
     1229                    '${a} invitation emails were sent.',
     1230                    mapping = {'a':  emails_sent})
    12281231        IWorkflowInfo(self.context).fireTransition('submit')
    12291232        # application_date is used in export files for sorting.
Note: See TracChangeset for help on using the changeset viewer.