server/session.py
branchstable
changeset 7706 359bc86d2827
parent 7665 0cd299c16f12
child 7730 8d0edec31aaf
--- a/server/session.py	Wed Jul 27 14:03:09 2011 +0200
+++ b/server/session.py	Wed Jul 27 14:17:47 2011 +0200
@@ -1276,12 +1276,13 @@
     is_internal_session = True
     running_dbapi_query = False
 
-    def __init__(self, repo, cnxprops=None):
+    def __init__(self, repo, cnxprops=None, safe=False):
         super(InternalSession, self).__init__(InternalManager(), repo, cnxprops,
                                               _id='internal')
         self.user._cw = self # XXX remove when "vreg = user._cw.vreg" hack in entity.py is gone
         self.cnxtype = 'inmemory'
-        self.disable_hook_categories('integrity')
+        if not safe:
+            self.disable_hook_categories('integrity')
 
     @property
     def cnxset(self):