Removed subscriber to INewLocalSite event to handle database upgrade only with generations
authorThierry Florac <tflorac@ulthar.net>
Sun, 11 Mar 2018 10:54:51 +0100
changeset 52 5847f556da86
parent 51 d2f833a2ec62
child 53 6e9c67caab86
Removed subscriber to INewLocalSite event to handle database upgrade only with generations
src/pyams_content_es/site.py
--- a/src/pyams_content_es/site.py	Wed Mar 07 17:45:29 2018 +0100
+++ b/src/pyams_content_es/site.py	Sun Mar 11 10:54:51 2018 +0100
@@ -19,30 +19,22 @@
 # import interfaces
 from pyams_content_es.interfaces import IContentIndexerUtility, INDEXER_NAME, IDocumentIndexTarget
 from pyams_utils.interfaces.site import ISiteGenerations
-from zope.site.interfaces import INewLocalSite
 
 # import packages
 from pyams_content_es.utility import ContentIndexerUtility
 from pyams_utils.container import find_objects_providing
 from pyams_utils.registry import utility_config, set_local_registry, query_utility
 from pyams_utils.site import check_required_utilities, site_factory
-from pyramid.events import subscriber
 
 
 REQUIRED_UTILITIES = ((IContentIndexerUtility, '', ContentIndexerUtility, INDEXER_NAME), )
 
 
-@subscriber(INewLocalSite)
-def handle_new_local_site(event):
-    """Create a new indexer utility when a site is created"""
-    site = event.manager.__parent__
-    check_required_utilities(site, REQUIRED_UTILITIES)
-
-
 @utility_config(name='PyAMS content indexer', provides=ISiteGenerations)
 class ContentIndexerGenerationsChecker(object):
     """Content indexer utility generations checker"""
 
+    order = 110
     generation = 1
 
     def evolve(self, site, current=None):