Edgewall Software

Ticket #547: recipients.patch

File recipients.patch, 1.1 KB (added by trac@…, 8 years ago)

Fix get_recipients to take a ticket ID

  • trac/Notify.py

     
    264264        return '[%s] #%s: %s' % (projname, self.ticket['id'], 
    265265                                     self.ticket['summary']) 
    266266 
    267     def get_recipients(self, ticket): 
     267    def get_recipients(self, resid): 
    268268        emails = [] 
    269269        cursor = self.db.cursor() 
    270         cursor.execute('SELECT reporter,cc FROM ticket WHERE id=%s', ticket['id']) 
     270        cursor.execute('SELECT reporter,cc FROM ticket WHERE id=%s', resid) 
    271271        row = cursor.fetchone() 
    272272        if row: 
    273273            emails += row[0] and self.get_email_addresses(row[0]) or [] 
    274274            emails += row[1] and self.get_email_addresses(row[1]) or [] 
    275275        cursor.execute('SELECT DISTINCT author,ticket FROM ticket_change ' 
    276                        ' WHERE ticket=%s', ticket['id']) 
     276                       ' WHERE ticket=%s', resid) 
    277277        rows = cursor.fetchall() 
    278278        for row in rows: 
    279279            emails += row[0] and self.get_email_addresses(row[0]) or []