Changes between Version 2 and Version 3 of Ticket #3678


Ignore:
Timestamp:
02/23/2016 12:04:08 PM (4 years ago)
Author:
trev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3678 – Description

    v2 v3  
    1414{{{ 
    1515from trac.env import Environment 
     16from trac.util.datefmt import to_datetime, utc 
    1617import trac.ticket.model as model 
     18from trac.ticket.notification import TicketNotifyEmail 
    1719 
    1820env = Environment(env_path) 
     21when = to_datetime(None, utc) 
    1922ticket = model.Ticket(env, ticket_id) 
    20 ticket.save_changes(author, comment) 
     23ticket.save_changes(author, comment, when=when) 
     24 
     25try: 
     26  tn = TicketNotifyEmail(env) 
     27  tn.notify(ticket, newticket=False, modtime=when) 
     28except Exception, e: 
     29  warn("Failure sending notification on change of " 
     30       "ticket #%s: %s" % (ticket.id, e)) 
    2131}}}