[CMF-checkins] CVS: CMF/DCWorkflow - DCWorkflow.py:1.8

Ken Manheimer klm@zope.com
Mon, 15 Oct 2001 12:12:25 -0400


Update of /cvs-repository/CMF/DCWorkflow
In directory cvs.zope.org:/tmp/cvs-serv22057

Modified Files:
	DCWorkflow.py 
Log Message:
._executeTransition(): Preserve (by copying) any existing, unchanged
state vars, rather than setting them to default value or just omitting
them, if there's no default.


=== CMF/DCWorkflow/DCWorkflow.py 1.7 => 1.8 ===
             elif tdef_exprs.has_key(id):
                 expr = tdef_exprs[id]
-            elif vdef.default_expr is not None:
-                expr = vdef.default_expr
+            elif former_status.has_key(id):
+                # Preserve former value
+                value = former_status[id]
             else:
-                value = vdef.default_value
+                if vdef.default_expr is not None:
+                    expr = vdef.default_expr
+                else:
+                    value = vdef.default_value
             if expr is not None:
                 # Evaluate an expression.
                 if econtext is None: