[saem-devel] [PATCH 05 of 10] [migration] Deactivate hooks prior to setting default use_authorityrecord

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Jan 31 09:49:10 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1485797382 -3600
#      Mon Jan 30 18:29:42 2017 +0100
# Node ID 34adf62121166742ee621c6048d4a5eeaaed861b
# Parent  bb3e714e217ea53fe27bb23f51c7ee036565005c
[migration] Deactivate hooks prior to setting default use_authorityrecord

diff --git a/cubicweb_saem_ref/migration/0.14.0_Any.py b/cubicweb_saem_ref/migration/0.14.0_Any.py
--- a/cubicweb_saem_ref/migration/0.14.0_Any.py
+++ b/cubicweb_saem_ref/migration/0.14.0_Any.py
@@ -7,12 +7,13 @@ sync_schema_props_perms(('CWUser', 'auth
 
 add_relation_definition(
     'OrganizationUnit', 'use_authorityrecord', 'AuthorityRecord')
 
 # Set default "use_authorityrecord" relation to existing AuthorityRecord
-rql('SET OU use_authorityrecord X WHERE OU archival_role AR, AR name "archival"')
-commit(ask_confirm=False)
+with cnx.deny_all_hooks_but():
+    rql('SET OU use_authorityrecord X WHERE OU archival_role AR, AR name "archival"')
+    commit(ask_confirm=False)
 
 add_attribute('Organization', 'ark')
 
 drop_cube('pyramid')
 


More information about the saem-devel mailing list