server/__init__.py
branchstable
changeset 5090 8c39d2bf58fd
parent 5043 fe52dd3936cf
child 5421 8167de96c523
equal deleted inserted replaced
5087:192ebe969779 5090:8c39d2bf58fd
   208     from cubicweb.server.session import hooks_control
   208     from cubicweb.server.session import hooks_control
   209     session = mhandler.session
   209     session = mhandler.session
   210     paths = [p for p in config.cubes_path() + [config.apphome]
   210     paths = [p for p in config.cubes_path() + [config.apphome]
   211              if exists(join(p, 'migration'))]
   211              if exists(join(p, 'migration'))]
   212     # deactivate every hooks but those responsible to set metadata
   212     # deactivate every hooks but those responsible to set metadata
   213     # so, NO INTEGRITY CHECKS are done, to have quicker db creation
   213     # so, NO INTEGRITY CHECKS are done, to have quicker db creation.
   214     with hooks_control(session, session.HOOKS_DENY_ALL, 'metadata'):
   214     # Active integrity is kept else we may pb such as two default
       
   215     # workflows for one entity type.
       
   216     with hooks_control(session, session.HOOKS_DENY_ALL, 'metadata',
       
   217                        'activeintegrity'):
   215         # execute cubicweb's pre<event> script
   218         # execute cubicweb's pre<event> script
   216         mhandler.exec_event_script('pre%s' % event)
   219         mhandler.exec_event_script('pre%s' % event)
   217         # execute cubes pre<event> script if any
   220         # execute cubes pre<event> script if any
   218         for path in reversed(paths):
   221         for path in reversed(paths):
   219             mhandler.exec_event_script('pre%s' % event, path)
   222             mhandler.exec_event_script('pre%s' % event, path)