--- a/src/pyams_utils/site.py Thu Mar 22 14:42:18 2018 +0100
+++ b/src/pyams_utils/site.py Thu Mar 22 14:43:34 2018 +0100
@@ -18,8 +18,8 @@
# import interfaces
from pyams_utils.interfaces import PYAMS_APPLICATION_SETTINGS_KEY, PYAMS_APPLICATION_DEFAULT_NAME, \
PYAMS_APPLICATION_FACTORY_KEY
-from pyams_utils.interfaces.site import ISiteRoot, INewLocalSiteCreatedEvent, ISiteUpgradeEvent, ISiteGenerations, \
- SITE_GENERATIONS_KEY, IConfigurationManager
+from pyams_utils.interfaces.site import ISiteRoot, ISiteRootFactory, INewLocalSiteCreatedEvent, ISiteUpgradeEvent, \
+ ISiteGenerations, SITE_GENERATIONS_KEY, IConfigurationManager
from zope.annotation.interfaces import IAnnotations
from zope.component.interfaces import IPossibleSite, ObjectEvent
from zope.traversing.interfaces import ITraversable
@@ -91,7 +91,7 @@
resolver = DottedNameResolver()
factory = resolver.maybe_resolve(factory)
else:
- factory = BaseSiteRoot
+ factory = request.registry.queryUtility(ISiteRootFactory, default=BaseSiteRoot)
application = root[application_key] = factory()
if IPossibleSite.providedBy(application):
sm = LocalSiteManager(application, default_folder=False)