Ticket #2259: trac_ticket_r2659.patch
File trac_ticket_r2659.patch, 1.2 KB (added by , 19 years ago) |
---|
-
trac/attachment.py
26 26 from trac.core import * 27 27 from trac.env import IEnvironmentSetupParticipant 28 28 from trac.mimeview import * 29 from trac.Notify import TicketNotifyEmail 30 from trac.ticket import Ticket 29 31 from trac.web import IRequestHandler 30 32 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 31 33 from trac.wiki import IWikiSyntaxProvider … … 331 333 except TracError: 332 334 pass # don't worry if there's nothing to replace 333 335 attachment.filename = None 336 now = time.time() 334 337 attachment.insert(filename, upload.file, size) 338 if attachment.parent_type == 'ticket': 339 tn = TicketNotifyEmail(self.env) 340 # before we can do this, we have to get the ticket 341 # that the attachment will modify 342 ticket = Ticket(self.env, tkt_id=attachment.parent_id) 343 tn.notify(ticket, newticket=False, modtime=now) 344 335 345 336 346 # Redirect the user to the newly created attachment 337 347 req.redirect(attachment.href())