cwvreg.py
changeset 2655 48cd71bdb5cd
parent 2650 18aec79ec3a3
parent 2651 3ad936634d2a
child 2657 de974465d381
--- a/cwvreg.py	Mon Aug 03 10:50:57 2009 +0200
+++ b/cwvreg.py	Mon Aug 03 10:53:31 2009 +0200
@@ -14,7 +14,8 @@
 from rql import RQLHelper
 
 from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
-                      ObjectNotFound, NoSelectableObject, RegistryNotFound)
+                      ObjectNotFound, NoSelectableObject, RegistryNotFound,
+                      RegistryOutOfDate)
 from cubicweb.vregistry import VRegistry, Registry
 from cubicweb.rtags import RTAGS
 
@@ -279,6 +280,15 @@
 
     def register_objects(self, path, force_reload=None):
         """overriden to remove objects requiring a missing interface"""
+        try:
+            self._register_objects(path, force_reload)
+        except RegistryOutOfDate:
+            # modification detected, reset and reload
+            self.reset()
+            self._register_objects(path, force_reload)
+
+    def _register_objects(self, path, force_reload=None):
+        """overriden to remove objects requiring a missing interface"""
         extrapath = {}
         for cubesdir in self.config.cubes_search_path():
             if cubesdir != self.config.CUBES_DIR: