Updated database upgrade code
authorThierry Florac <tflorac@ulthar.net>
Sat, 10 Mar 2018 02:05:08 +0100
changeset 32 49878f09ec8a
parent 31 13548b20786f
child 33 0ea8a9e85fe1
Updated database upgrade code
src/pyams_sequence/site.py
--- a/src/pyams_sequence/site.py	Thu Mar 08 09:12:14 2018 +0100
+++ b/src/pyams_sequence/site.py	Sat Mar 10 02:05:08 2018 +0100
@@ -18,7 +18,6 @@
 # import interfaces
 from pyams_sequence.interfaces import ISequentialIntIds, ISequentialIdInfo, IInternalReference, IInternalReferencesList
 from pyams_utils.interfaces.site import ISiteGenerations
-from zope.site.interfaces import INewLocalSite
 
 # import packages
 from pyams_catalog.index import FieldIndexWithInterface, KeywordIndexWithInterface
@@ -26,7 +25,6 @@
 from pyams_sequence.utility import SequentialIntIds
 from pyams_utils.registry import utility_config
 from pyams_utils.site import check_required_utilities
-from pyramid.events import subscriber
 
 
 REQUIRED_UTILITIES = ((ISequentialIntIds, '', SequentialIntIds, 'Sequential IDs'), )
@@ -40,18 +38,11 @@
                                                                     'discriminator': 'references'})]
 
 
-@subscriber(INewLocalSite)
-def handle_new_local_site(event):
-    """Check for required utilities when a site is created"""
-    site = event.manager.__parent__
-    check_required_utilities(site, REQUIRED_UTILITIES)
-    check_required_indexes(site, REQUIRED_INDEXES)
-
-
 @utility_config(name='PyAMS sequence', provides=ISiteGenerations)
 class SequenceGenerationsChecker(object):
     """PyAMS sequence generations checker"""
 
+    order = 60
     generation = 1
 
     def evolve(self, site, current=None):