server/session.py
changeset 8813 cf94a7f980fe
parent 8812 52af67a2f0a5
child 8814 37fd037c0526
--- a/server/session.py	Wed Mar 27 17:09:55 2013 +0100
+++ b/server/session.py	Wed Mar 27 14:05:14 2013 +0100
@@ -990,14 +990,10 @@
 
     hooks_mode = tx_attr('hooks_mode')
 
-    def set_hooks_mode(self, mode):
+    def init_hooks_mode_categories(self, mode, categories):
         assert mode is HOOKS_ALLOW_ALL or mode is HOOKS_DENY_ALL
         oldmode = self._tx.hooks_mode
         self._tx.hooks_mode = mode
-        return oldmode
-
-    def init_hooks_mode_categories(self, mode, categories):
-        oldmode = self.set_hooks_mode(mode)
         if mode is self.HOOKS_DENY_ALL:
             changes = self.enable_hook_categories(*categories)
         else:
@@ -1018,7 +1014,7 @@
                     else:
                         return self.enable_hook_categories(*categories)
             finally:
-                self.set_hooks_mode(oldmode)
+                self._tx.hooks_mode = oldmode
 
     disabled_hook_categories = tx_attr('disabled_hook_cats')
     enabled_hook_categories = tx_attr('enabled_hook_cats')