274 if osp.exists(apc): |
274 if osp.exists(apc): |
275 if self.config.free_wheel: |
275 if self.config.free_wheel: |
276 from cubicweb.server.hooks import setowner_after_add_entity |
276 from cubicweb.server.hooks import setowner_after_add_entity |
277 self.repo.hm.unregister_hook(setowner_after_add_entity, |
277 self.repo.hm.unregister_hook(setowner_after_add_entity, |
278 'after_add_entity', '') |
278 'after_add_entity', '') |
279 self.deactivate_verification_hooks() |
279 self.cmd_deactivate_verification_hooks() |
280 self.info('executing %s', apc) |
280 self.info('executing %s', apc) |
281 confirm = self.confirm |
281 confirm = self.confirm |
282 execscript_confirm = self.execscript_confirm |
282 execscript_confirm = self.execscript_confirm |
283 self.confirm = yes |
283 self.confirm = yes |
284 self.execscript_confirm = yes |
284 self.execscript_confirm = yes |
288 self.confirm = confirm |
288 self.confirm = confirm |
289 self.execscript_confirm = execscript_confirm |
289 self.execscript_confirm = execscript_confirm |
290 if self.config.free_wheel: |
290 if self.config.free_wheel: |
291 self.repo.hm.register_hook(setowner_after_add_entity, |
291 self.repo.hm.register_hook(setowner_after_add_entity, |
292 'after_add_entity', '') |
292 'after_add_entity', '') |
293 self.reactivate_verification_hooks() |
293 self.cmd_reactivate_verification_hooks() |
294 |
294 |
295 # schema synchronization internals ######################################## |
295 # schema synchronization internals ######################################## |
296 |
296 |
297 def _synchronize_permissions(self, ertype): |
297 def _synchronize_permissions(self, ertype): |
298 """permission synchronization for an entity or relation type""" |
298 """permission synchronization for an entity or relation type""" |
1071 |
1071 |
1072 def rqliter(self, rql, kwargs=None, ask_confirm=True): |
1072 def rqliter(self, rql, kwargs=None, ask_confirm=True): |
1073 return ForRqlIterator(self, rql, None, ask_confirm) |
1073 return ForRqlIterator(self, rql, None, ask_confirm) |
1074 |
1074 |
1075 def cmd_deactivate_verification_hooks(self): |
1075 def cmd_deactivate_verification_hooks(self): |
1076 self.repo.hm.deactivate_verification_hooks() |
1076 self.config.disabled_hooks_categories.add('integrity') |
1077 |
1077 |
1078 def cmd_reactivate_verification_hooks(self): |
1078 def cmd_reactivate_verification_hooks(self): |
1079 self.repo.hm.reactivate_verification_hooks() |
1079 self.config.disabled_hooks_categories.remove('integrity') |
1080 |
1080 |
1081 # broken db commands ###################################################### |
1081 # broken db commands ###################################################### |
1082 |
1082 |
1083 def cmd_change_attribute_type(self, etype, attr, newtype, commit=True): |
1083 def cmd_change_attribute_type(self, etype, attr, newtype, commit=True): |
1084 """low level method to change the type of an entity attribute. This is |
1084 """low level method to change the type of an entity attribute. This is |