Commit 479f03d8 authored by wenjie.zheng's avatar wenjie.zheng

lazy_class.py: clean erp5workflow_method_registry at the initialization of site.

parent b8b596e5
...@@ -164,6 +164,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -164,6 +164,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
PortalTypeMetaClass.subclass_register.setdefault(parent, []).append(cls) PortalTypeMetaClass.subclass_register.setdefault(parent, []).append(cls)
cls.workflow_method_registry = {} cls.workflow_method_registry = {}
cls.erp5workflow_method_registry = {}
cls.__isghost__ = True cls.__isghost__ = True
super(GhostBaseMetaClass, cls).__init__(name, bases, dictionary) super(GhostBaseMetaClass, cls).__init__(name, bases, dictionary)
...@@ -242,12 +243,14 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -242,12 +243,14 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
'__doc__', '__doc__',
'__setstate__', '__setstate__',
'workflow_method_registry', 'workflow_method_registry',
'erp5workflow_method_registry',
'__isghost__', '__isghost__',
'portal_type'): 'portal_type'):
delattr(cls, attr) delattr(cls, attr)
# generate a ghostbase that derives from all previous bases # generate a ghostbase that derives from all previous bases
ghostbase = GhostBaseMetaClass('GhostBase', cls.__bases__, {}) ghostbase = GhostBaseMetaClass('GhostBase', cls.__bases__, {})
cls.workflow_method_registry.clear() cls.workflow_method_registry.clear()
#cls.erp5workflow_method_registry.clear()
cls.__bases__ = (ghostbase,) cls.__bases__ = (ghostbase,)
cls.__isghost__ = True cls.__isghost__ = True
cls.resetAcquisition() cls.resetAcquisition()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment