Commit 967f7652 authored by Nicolas Dumazet's avatar Nicolas Dumazet

put dynamic module registration in initializeProduct to avoid depending

on any kind of initialization order


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42393 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2ab436b
...@@ -1102,6 +1102,15 @@ def initializeProduct( context, ...@@ -1102,6 +1102,15 @@ def initializeProduct( context,
except: except:
LOG("ERP5Type", BLATHER, "No help directory for %s" % product_name) LOG("ERP5Type", BLATHER, "No help directory for %s" % product_name)
# create dynamic modules if they dont exist, this only ever happens
# once.
try:
import erp5.portal_type
except ImportError:
from dynamic.portal_type_class import initializeDynamicModules
initializeDynamicModules()
import erp5.portal_type
# Tools initialization # Tools initialization
tools = portal_tools tools = portal_tools
if len(tools) > 0: if len(tools) > 0:
......
...@@ -114,9 +114,6 @@ def initialize( context ): ...@@ -114,9 +114,6 @@ def initialize( context ):
content_constructors = content_constructors, content_constructors = content_constructors,
content_classes = content_classes) content_classes = content_classes)
from dynamic.portal_type_class import initializeDynamicModules
initializeDynamicModules()
# Register our Workflow factories directly (if on CMF 2) # Register our Workflow factories directly (if on CMF 2)
Products.ERP5Type.Workflow.registerAllWorkflowFactories(context) Products.ERP5Type.Workflow.registerAllWorkflowFactories(context)
# We should register local constraints at some point # We should register local constraints at some point
......
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