Edgewall Software

Ticket #6048: apply_action_side_effects.patch

File apply_action_side_effects.patch, 847 bytes (added by kirean@…, 5 years ago)
  • DeleteTicket.py

     
    3838        return ("delete ticket", '', "This ticket will be deleted.") 
    3939 
    4040    def get_ticket_changes(self, req, ticket, action): 
     41        # We need to trigger an actual change to the ticket to 
     42        # activate the call to apply_action_side_effects 
     43        if not req.args.get('comment',''): 
     44            req.args['comment'] = 'Ticket deleted.' 
     45 
     46        # Since we will apply action side effects we should warn about this 
     47        # in preview mode. 
     48        if 'preview' in req.args: 
     49            req.warning("This ticket will be deleted.'") 
     50             
    4151        return {} 
    4252 
    4353    def apply_action_side_effects(self, req, ticket, action):