workflows: do not reuse action instances in default workflow

(manual cherry pick of parts of 9ecdc0be)
This commit is contained in:
Frédéric Péters 2013-03-05 13:36:33 +01:00
parent ab694ac166
commit 57ffd032b2
1 changed files with 31 additions and 0 deletions

View File

@ -16,6 +16,7 @@
from qommon import ezt
from cStringIO import StringIO
import copy
try:
import elementtree.ElementTree as ET
@ -281,26 +282,56 @@ class Workflow(StorableObject):
notify_change_user_email = None
if notify_new_receiver_email:
notify_new_receiver_email.parent = just_submitted_status
just_submitted_status.items.append(notify_new_receiver_email)
if notify_new_user_email:
notify_new_user_email.parent = just_submitted_status
just_submitted_status.items.append(notify_new_user_email)
just_submitted_status.items.append(jump_to_new)
if notify_change_receiver_email:
accepted_status.items.append(notify_change_receiver_email)
notify_change_receiver_email.parent = accepted_status
notify_change_receiver_email = copy.copy(notify_change_receiver_email)
handled_status.items.append(notify_change_receiver_email)
notify_change_receiver_email.parent = handled_status
notify_change_receiver_email = copy.copy(notify_change_receiver_email)
rejected_status.items.append(notify_change_receiver_email)
notify_change_receiver_email.parent = rejected_status
notify_change_receiver_email = copy.copy(notify_change_receiver_email)
finished_status.items.append(notify_change_receiver_email)
notify_change_receiver_email.parent = finished_status
if notify_change_user_email:
accepted_status.items.append(notify_change_user_email)
notify_change_user_email.parent = accepted_status
notify_change_user_email = copy.copy(notify_change_user_email)
handled_status.items.append(notify_change_user_email)
notify_change_user_email.parent = handled_status
notify_change_user_email = copy.copy(notify_change_user_email)
rejected_status.items.append(notify_change_user_email)
notify_change_user_email.parent = rejected_status
notify_change_user_email = copy.copy(notify_change_user_email)
finished_status.items.append(notify_change_user_email)
notify_change_user_email.parent = finished_status
new_status.items.append(commentable)
commentable.parent = new_status
commentable = copy.copy(commentable)
accepted_status.items.append(commentable_all)
commentable.parent = accepted_status
commentable = copy.copy(commentable)
handled_status.items.append(commentable_all)
commentable.parent = handled_status
accept = ChoiceWorkflowStatusItem()
accept.id = '_accept'