Permalink
Browse files

When change parent, add a comment to both new & old parent

  • Loading branch information...
1 parent c39c97b commit 04889d37373f953f25fc6bb28d61076e93147683 @gaod gaod committed Sep 3, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 tracsubtickets/api.py
View
@@ -149,10 +149,18 @@ def ticket_changed(self, ticket, comment, author, old_values):
for parent in old_parents - new_parents:
cursor.execute("DELETE FROM subtickets WHERE parent=%s AND child=%s",
(parent, ticket.id))
+ # add a comment to old parent
+ xticket = Ticket(self.env, parent)
+ xticket.save_changes(author, 'Remove a subticket ' + str(ticket.id) + '.')
+
# add new parents
for parent in new_parents - old_parents:
cursor.execute("INSERT INTO subtickets VALUES(%s, %s)",
(parent, ticket.id))
+ # add a comment to new parent
+ xticket = Ticket(self.env, parent)
+ xticket.save_changes(author, 'Add a subticket ' + str(ticket.id) + '.')
+
db.commit()
def ticket_deleted(self, ticket):

0 comments on commit 04889d3

Please sign in to comment.