Changes between Initial Version and Version 6 of Ticket #10194


Ignore:
Timestamp:
Mar 21, 2013 3:13:10 PM (19 months ago)
Author:
rjollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10194

    • Property Cc jun66j5 falkb added
    • Property Status changed from new to assigned
    • Property Owner changed from coderanger to rjollos
  • Ticket #10194 – Description

    initial v6  
     1This was found in the TicketImportPlugin, see #10188, and took me some time to debug. The following piece of code (given an `env` environment): 
    12 
    2 This was found in the TicketImportPlugin, see #10188, and took me some time to debug. The following piece of code (given and "env" environment): 
    33{{{ 
    4                 from trac.ticket.web_ui import Ticket  
    5                 from datetime import datetime  
    6                 from trac.util.datefmt import utc  
    7                 ticket = Ticket(env)  
    8                 ticket['summary'] = 'The summary'  
    9                 ticket.insert()  
    10                 ticket['blockedby'] = str(ticket.id)  
    11                 ticket.save_changes('someone',comment='Some comments', when=datetime.now(utc))  
     4#!python 
     5from trac.ticket.web_ui import Ticket  
     6from datetime import datetime  
     7from trac.util.datefmt import utc  
     8ticket = Ticket(env)  
     9ticket['summary'] = 'The summary'  
     10ticket.insert()  
     11ticket['blockedby'] = str(ticket.id)  
     12ticket.save_changes('someone', comment='Some comments', 
     13                    when=datetime.now(utc))  
    1214}}} 
    1315 
    1416will work if the MasterTicketsPlugin is not installed, but will fail if it is installed, with the following error: 
    1517{{{ 
    16     ticket.save_changes('someone','Some comments', when=datetime.now(utc)) 
     18ticket.save_changes('someone', 'Some comments', 
     19                    when=datetime.now(utc)) 
    1720  File "/Users/francois/ticketimportplugin/0.11/env2.5/lib/python2.5/site-packages/Trac-0.12-py2.5.egg/trac/ticket/model.py", line 353, in save_changes 
    1821    listener.ticket_changed(self, comment, author, old_values)