appy.gen: stop storing workflow task attribute '_v_appy_do' as a volatile attr in ZODB (renamed it '_appy_do'). It seems to be removed by a sub-transaction during a long transition.
This commit is contained in:
parent
c7633ecc8b
commit
7294cc0c4d
|
@ -147,14 +147,14 @@ def do(transitionName, stateChange, logger):
|
||||||
doAction = False
|
doAction = False
|
||||||
if transition.action:
|
if transition.action:
|
||||||
doAction = True
|
doAction = True
|
||||||
if hasattr(ploneObj, '_v_appy_do') and \
|
if hasattr(ploneObj, '_appy_do') and \
|
||||||
not ploneObj._v_appy_do['doAction']:
|
not ploneObj._appy_do['doAction']:
|
||||||
doAction = False
|
doAction = False
|
||||||
doNotify = False
|
doNotify = False
|
||||||
if transition.notify:
|
if transition.notify:
|
||||||
doNotify = True
|
doNotify = True
|
||||||
if hasattr(ploneObj, '_v_appy_do') and \
|
if hasattr(ploneObj, '_appy_do') and \
|
||||||
not ploneObj._v_appy_do['doNotify']:
|
not ploneObj._appy_do['doNotify']:
|
||||||
doNotify = False
|
doNotify = False
|
||||||
elif not getattr(ploneObj.getTool().appy(), 'enableNotifications'):
|
elif not getattr(ploneObj.getTool().appy(), 'enableNotifications'):
|
||||||
# We do not notify if the "notify" flag in the tool is disabled.
|
# We do not notify if the "notify" flag in the tool is disabled.
|
||||||
|
@ -174,7 +174,7 @@ def do(transitionName, stateChange, logger):
|
||||||
if doNotify:
|
if doNotify:
|
||||||
notifier.sendMail(obj, transition, transitionName, workflow, logger)
|
notifier.sendMail(obj, transition, transitionName, workflow, logger)
|
||||||
# Produce a message to the user
|
# Produce a message to the user
|
||||||
if hasattr(ploneObj, '_v_appy_do') and not ploneObj._v_appy_do['doSay']:
|
if hasattr(ploneObj, '_appy_do') and not ploneObj._appy_do['doSay']:
|
||||||
# We do not produce any message if the transition was triggered
|
# We do not produce any message if the transition was triggered
|
||||||
# programmatically.
|
# programmatically.
|
||||||
return
|
return
|
||||||
|
|
|
@ -280,7 +280,7 @@ class AbstractWrapper:
|
||||||
# Set in a versatile attribute details about what to execute or not
|
# Set in a versatile attribute details about what to execute or not
|
||||||
# (actions, notifications) after the transition has been executed by DC
|
# (actions, notifications) after the transition has been executed by DC
|
||||||
# workflow.
|
# workflow.
|
||||||
self.o._v_appy_do = {'doAction': doAction, 'doNotify': doNotify,
|
self.o._appy_do = {'doAction': doAction, 'doNotify': doNotify,
|
||||||
'doSay': False}
|
'doSay': False}
|
||||||
if not doHistory:
|
if not doHistory:
|
||||||
comment = '_invisible_' # Will not be displayed.
|
comment = '_invisible_' # Will not be displayed.
|
||||||
|
@ -289,7 +289,7 @@ class AbstractWrapper:
|
||||||
# object by consulting the target state of the last transition in
|
# object by consulting the target state of the last transition in
|
||||||
# this workflow_history.
|
# this workflow_history.
|
||||||
wfTool.doActionFor(self.o, transitionName, comment=comment)
|
wfTool.doActionFor(self.o, transitionName, comment=comment)
|
||||||
del self.o._v_appy_do
|
del self.o._appy_do
|
||||||
|
|
||||||
def log(self, message, type='info'): return self.o.log(message, type)
|
def log(self, message, type='info'): return self.o.log(message, type)
|
||||||
def say(self, message, type='info'): return self.o.say(message, type)
|
def say(self, message, type='info'): return self.o.say(message, type)
|
||||||
|
|
Loading…
Reference in a new issue