Updated database upgrade code and removed INewLocalSite event subscriber
authorThierry Florac <tflorac@ulthar.net>
Sat, 10 Mar 2018 02:10:04 +0100
changeset 63 aa14e031f381
parent 62 bee8ce78226a
child 64 9655802d1230
Updated database upgrade code and removed INewLocalSite event subscriber
src/pyams_portal/site.py
--- a/src/pyams_portal/site.py	Thu Mar 08 09:11:32 2018 +0100
+++ b/src/pyams_portal/site.py	Sat Mar 10 02:10:04 2018 +0100
@@ -18,29 +18,21 @@
 # import interfaces
 from pyams_portal.interfaces import IPortalTemplateContainer
 from pyams_utils.interfaces.site import ISiteGenerations
-from zope.site.interfaces import INewLocalSite
 
 # import packages
 from pyams_portal.template import PortalTemplateContainer
 from pyams_utils.registry import utility_config
 from pyams_utils.site import check_required_utilities
-from pyramid.events import subscriber
 
 
 REQUIRED_UTILITIES = ((IPortalTemplateContainer, '', PortalTemplateContainer, 'Portal templates'), )
 
 
-@subscriber(INewLocalSite)
-def handle_new_local_site(event):
-    """Create a new templates container when a site is created"""
-    site = event.manager.__parent__
-    check_required_utilities(site, REQUIRED_UTILITIES)
-
-
 @utility_config(name='PyAMS portal', provides=ISiteGenerations)
 class PortalGenerationsChecker(object):
     """Portal generations checker"""
 
+    order = 70
     generation = 1
 
     def evolve(self, site, current=None):