Commit 1c613aeb authored by Aurel's avatar Aurel

ERP5Type: allow to load former MembershipTool

also remove dead code
parent 9f6908ac
......@@ -189,3 +189,18 @@ import zExceptions
ModuleSecurityInfo('zExceptions').declarePublic(*filter(
lambda x: Exception in getattr(getattr(zExceptions, x), '__mro__', ()),
dir(zExceptions)))
# BBB : allow load of fomer Products.CMFDefault.MembershipTool
# that has been replaced by Products.CMFCore.MembershipTool
try:
from Products.CMFDefault.MembershipTool import MembershipTool
except ImportError:
import sys, imp
m = 'Products.CMFDefault'
sys.modules[m] = imp.new_module(m)
m += ".MembershipTool"
sys.modules[m] = m = imp.new_module(m)
from Products.CMFCore.MembershipTool import MembershipTool
m.MembershipTool = MembershipTool
del m
......@@ -468,14 +468,6 @@ def synchronizeDynamicModules(context, force=False):
except AttributeError:
pass # no Activity Tool yet
from Products.CMFCore.MembershipTool import MembershipTool
tool = getattr(portal, "portal_membership", None)
if tool and tool.__class__ is not MembershipTool:
assert not tool._p_changed
tool.__class__ = MembershipTool
assert tool._p_changed
migrate = True
for tool_id in ("portal_properties", "portal_uidannotation",
"portal_uidgenerator", "portal_uidhandler"):
if portal.hasObject(tool_id):
......
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