Updated database upgrade code and removed INewLocalSite event subscriber
authorThierry Florac <tflorac@ulthar.net>
Sat, 10 Mar 2018 02:41:35 +0100
changeset 36 c56c44855000
parent 35 95208835857e
child 37 3a96f0520832
Updated database upgrade code and removed INewLocalSite event subscriber
src/pyams_catalog/site.py
--- a/src/pyams_catalog/site.py	Sat Mar 10 02:40:12 2018 +0100
+++ b/src/pyams_catalog/site.py	Sat Mar 10 02:41:35 2018 +0100
@@ -23,7 +23,6 @@
 from pyams_utils.interfaces.site import ISiteGenerations
 from zope.intid.interfaces import IIntIds, IIntIdRemovedEvent
 from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent
-from zope.site.interfaces import INewLocalSite
 
 # import packages
 from hypatia.catalog import Catalog
@@ -39,17 +38,11 @@
                       (ICatalog, '', Catalog, 'Catalog'),)
 
 
-@subscriber(INewLocalSite)
-def handle_new_local_site(event):
-    """Create a new catalog when a site is created"""
-    site = event.manager.__parent__
-    check_required_utilities(site, REQUIRED_UTILITIES)
-
-
 @utility_config(name='PyAMS catalog', provides=ISiteGenerations)
 class CatalogGenerationsChecker(object):
     """Catalog generations checker"""
 
+    order = 40
     generation = 1
 
     def evolve(self, site, current=None):