cwvreg.py
changeset 2651 3ad936634d2a
parent 2613 5e19c2bb370e
child 2655 48cd71bdb5cd
--- a/cwvreg.py	Sun Aug 02 12:00:17 2009 +0200
+++ b/cwvreg.py	Sun Aug 02 19:32:57 2009 +0200
@@ -13,7 +13,8 @@
 
 from rql import RQLHelper
 
-from cubicweb import ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid
+from cubicweb import (ETYPE_NAME_MAP, Binary, UnknownProperty, UnknownEid,
+                      RegistryOutOfDate)
 from cubicweb.vregistry import VRegistry, ObjectNotFound, NoSelectableObject
 from cubicweb.rtags import RTAGS
 
@@ -139,6 +140,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: