Changeset 3820

Show
Ignore:
Timestamp:
06/10/08 21:57:26 (5 months ago)
Author:
retracile
Message:

AdvancedTicketWorkflowPlugin: Xref feature to add a comment to the local ticket; be warned that the xref operation is not robust. Bump version to 0.9

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • advancedticketworkflowplugin/0.11/advancedworkflow/controller.py

    r3730 r3820  
    44 
    55import os 
     6import time 
    67from subprocess import call 
    78from genshi.builder import tag 
     
    356357    <someaction>.operations = xref 
    357358    <someaction>.xref = "Ticket %s is related to this ticket" 
     359    <someaction>.xref_local = "Ticket %s was marked as related to this ticket" 
    358360 
    359361    Don't forget to add the `TicketWorkflowOpXRef` to the workflow 
     
    388390        ticketnum = req.args.get(id).strip('#') 
    389391        actions = ConfigurableTicketWorkflow(self.env).actions 
     392        author = req.authname 
     393 
     394        # Add a comment to the "remote" ticket to indicate this ticket is 
     395        # related to it. 
    390396        format_string = actions[action].get('xref', 
    391397                                        'Ticket %s is related to this ticket') 
    392         author = req.authname 
    393398        comment = format_string % ('#%s' % ticket.id) 
     399        # FIXME: This assumes the referenced ticket exists. 
    394400        xticket = model.Ticket(self.env, ticketnum) 
    395         # We _assume_ we have sufficient permissions to comment on the other 
    396         # ticket. 
     401        # FIXME: We _assume_ we have sufficient permissions to comment on the 
     402        # other ticket. 
    397403        xticket.save_changes(author, comment) 
     404 
     405        # Add a comment to this ticket to indicate that the "remote" ticket is 
     406        # related to it.  (But only if <action>.xref_local was set in the 
     407        # config.) 
     408        format_string = actions[action].get('xref_local', 
     409            'Ticket %s was marked as related to this ticket') 
     410        if format_string: 
     411            comment = format_string % ('#%s' % ticketnum) 
     412            time.sleep(1) # FIXME: Hack around IntegrityError 
     413            # HACK: Grab a new ticket object to avoid getting 
     414            # "OperationalError: no such column: new" 
     415            xticket = model.Ticket(self.env, ticket.id) 
     416            xticket.save_changes(author, comment) 
  • advancedticketworkflowplugin/0.11/setup.py

    r3730 r3820  
    55setup(   
    66        name='AdvancedTicketWorkflowPlugin', 
    7         version='0.8', 
     7        version='0.9', 
    88        author = 'Eli Carter', 
    99        author_email = 'elicarter@retracile.net',