misc/migration/3.10.0_Any.py
changeset 11278 19fcce6dc6d1
parent 10907 9ae707db5265
parent 11178 b3d3e23be27b
--- a/misc/migration/3.10.0_Any.py	Wed May 04 23:52:36 2016 +0200
+++ b/misc/migration/3.10.0_Any.py	Thu Jun 16 14:19:20 2016 +0200
@@ -1,7 +1,5 @@
 from six import text_type
 
-from cubicweb.server.session import hooks_control
-
 for uri, cfg in config.read_sources_file().items():
     if uri in ('system', 'admin'):
         continue
@@ -11,7 +9,7 @@
 add_relation_definition('CWSource', 'cw_source', 'CWSource')
 add_entity_type('CWSourceHostConfig')
 
-with hooks_control(session, session.HOOKS_ALLOW_ALL, 'cw.sources'):
+with session.allow_all_hooks_but('cw.sources'):
     create_entity('CWSource', type=u'native', name=u'system')
 commit()