# HG changeset patch # User Sylvain Thénault # Date 1249492447 -7200 # Node ID 6ee816eb9f2513c358118e567ab1d53dc194cd7f # Parent 60d728bdcba5378f86857f63dc46bcbec9b6b5a4 [hooksmanager] hooks should be reseted after vreg reload diff -r 60d728bdcba5 -r 6ee816eb9f25 server/repository.py --- a/server/repository.py Wed Aug 05 19:13:35 2009 +0200 +++ b/server/repository.py Wed Aug 05 19:14:07 2009 +0200 @@ -28,11 +28,11 @@ from yams import BadSchemaDefinition from rql import RQLSyntaxError -from cubicweb import (CW_SOFTWARE_ROOT, UnknownEid, AuthenticationError, +from cubicweb import (CW_SOFTWARE_ROOT, CW_MIGRATION_MAP, CW_EVENT_MANAGER, + UnknownEid, AuthenticationError, ExecutionError, ETypeNotSupportedBySources, RTypeNotSupportedBySources, BadConnectionId, Unauthorized, ValidationError, - ExecutionError, typed_eid, - CW_MIGRATION_MAP) + typed_eid) from cubicweb.cwvreg import CubicWebVRegistry from cubicweb.schema import VIRTUAL_RTYPES, CubicWebSchema from cubicweb import server @@ -228,6 +228,7 @@ # register a task to cleanup expired session self.looping_task(self.config['session-time']/3., self.clean_sessions) + CW_EVENT_MANAGER.bind('after-registry-load', self.reset_hooks) # internals ############################################################### @@ -247,7 +248,10 @@ # full reload of all appobjects self.vreg.reset() self.vreg.set_schema(schema) - self.hm.set_schema(schema) + self.reset_hooks() + + def reset_hooks(self): + self.hm.set_schema(self.schema) self.hm.register_system_hooks(self.config) # instance specific hooks if self.config.instance_hooks: