Beispiel #1
0
    def restore(self):
        CremeEntity.restore(self)

        # TODO: in a signal handler instead ?
        #       (we need a restore signal, or an official "backup" feature -- see HistoryLine)
        if self.status in (constants.MAIL_STATUS_NOTSENT, constants.MAIL_STATUS_SENDINGERROR):
            # TODO: regroup the 'refresh' message, to avoid flooding the job manager
            from ..creme_jobs import entity_emails_send_type

            entity_emails_send_type.refresh_job()
Beispiel #2
0
    def restore(self):
        CremeEntity.restore(self)

        # TODO: in a signal handler instead ?
        #       (we need a restore signal, or an official "backup" feature -- see HistoryLine)
        from .sending import EmailSending, SENDING_STATE_DONE

        if EmailSending.objects.filter(campaign=self).exclude(
                state=SENDING_STATE_DONE).exists():
            # TODO: regroup the 'refresh' message, to avoid flooding the job manager
            from ..creme_jobs import campaign_emails_send_type

            campaign_emails_send_type.refresh_job()