Commit cf2bad14 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

fix cw properties initialization

--HG--
branch : stable
parent b23bbb31368c
......@@ -228,8 +228,8 @@ class CubicWebVRegistry(VRegistry):
config.init_log(debug=debug)
super(CubicWebVRegistry, self).__init__(config)
self.schema = None
self.reset()
self.initialized = False
self.reset()
def setdefault(self, regid):
try:
......@@ -256,10 +256,11 @@ class CubicWebVRegistry(VRegistry):
# two special registries, propertydefs which care all the property
# definitions, and propertyvals which contains values for those
# properties
self['propertydefs'] = {}
self['propertyvalues'] = self.eprop_values = {}
for key, propdef in self.config.eproperty_definitions():
self.register_property(key, **propdef)
if not self.initialized:
self['propertydefs'] = {}
self['propertyvalues'] = self.eprop_values = {}
for key, propdef in self.config.eproperty_definitions():
self.register_property(key, **propdef)
if path is not None and force_reload:
cleanup_sys_modules(path)
cubes = self.config.cubes()
......
......@@ -207,7 +207,9 @@ class VRegistry(dict):
self.config = config
def reset(self, path=None, force_reload=None):
self.clear()
# don't use self.clear, we want to keep existing subdictionaries
for subdict in self.itervalues():
subdict.clear()
self._lastmodifs = {}
def __getitem__(self, name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment