sobjects/notification.py
branchtls-sprint
changeset 877 decb67772c92
parent 803 ab8d2282e738
child 1263 01152fffd593
equal deleted inserted replaced
876:f652660ae9a6 877:decb67772c92
   133       override call)
   133       override call)
   134     """
   134     """
   135     msgid_timestamp = True
   135     msgid_timestamp = True
   136     
   136     
   137     def recipients(self):
   137     def recipients(self):
   138         finder = self.vreg.select_component('recipients_finder',
   138         finder = self.vreg.select_component('recipients_finder', self.req, self.rset)
   139                                             req=self.req, rset=self.rset)
       
   140         return finder.recipients()
   139         return finder.recipients()
   141         
   140         
   142     def subject(self):
   141     def subject(self):
   143         entity = self.entity(0, 0)
   142         entity = self.entity(0, 0)
   144         subject = self.req._(self.message)
   143         subject = self.req._(self.message)
   173     def render_and_send(self, **kwargs):
   172     def render_and_send(self, **kwargs):
   174         """generate and send an email message for this view"""
   173         """generate and send an email message for this view"""
   175         self._kwargs = kwargs
   174         self._kwargs = kwargs
   176         recipients = self.recipients()
   175         recipients = self.recipients()
   177         if not recipients:
   176         if not recipients:
   178             self.info('skipping %s%s notification which has no recipients',
   177             self.info('skipping %s notification, no recipients', self.id)
   179                       self.id, self.accepts)
       
   180             return
   178             return
   181         if not isinstance(recipients[0], tuple):
   179         if not isinstance(recipients[0], tuple):
   182             from warnings import warn
   180             from warnings import warn
   183             warn('recipients should now return a list of 2-uple (email, language)',
   181             warn('recipients should now return a list of 2-uple (email, language)',
   184                  DeprecationWarning, stacklevel=1)
   182                  DeprecationWarning, stacklevel=1)