File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
bread/contrib/workflows/models Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,13 @@ def cancel(self, save=True):
273273 self .save ()
274274
275275 def save (self , * args , ** kwargs ):
276- self .update_workflow_state (runactions = True )
276+ if self .pk is not None :
277+ self .update_workflow_state (runactions = True )
277278 if not self .completed and not self .cancelled and self .done :
278279 self .completed = timezone .now ()
279280 super ().save (* args , ** kwargs )
281+ self .update_workflow_state (runactions = True )
282+ super ().save (* args , ** kwargs )
280283
281284 def update_workflow_state (self , runactions = False ):
282285 # don't do anything on the workflow after it has been cancelled
@@ -305,7 +308,6 @@ def update_workflow_state(self, runactions=False):
305308 setattr (self , node .name , actionresult )
306309 if isinstance (node , Decision ):
307310 if any (n .done (self ) for n , c in node .inputs ):
308- node .decide (self )
309311 decision = node .decide (self )
310312 if decision != getattr (self , node .name ):
311313 state_changed = True
You can’t perform that action at this time.
0 commit comments