Workaround for DAG invalidation - remove all expressions before deleting an object.

This commit is contained in:
Markus Lampert
2017-10-10 17:12:05 -07:00
parent d2b1768e18
commit 46d120071e
4 changed files with 26 additions and 0 deletions

View File

@@ -87,3 +87,12 @@ def getPublicObject(obj):
return getPublicObject(body)
return obj
def clearExpressionEngine(obj):
'''clearExpressionEngine(obj) ... removes all expressions from obj.
There is currently a bug that invalidates the DAG if an object
is deleted that still has one or more expressions attached to it.
Use this function to remove all expressions before deletion.'''
if hasattr(obj, 'ExpressionEngine'):
for attr,expr in obj.ExpressionEngine:
obj.setExpression(attr, None)