Commit 43bb1933 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Component accessors required to fill registry dict may have not be generated.

For now, just ignore it but it may be required later to define dummy accessors
so that the registry and Components can be loaded even when their accessors
are not generated yet.
parent d111df6e
......@@ -111,13 +111,19 @@ class ComponentDynamicPackage(ModuleType):
# Only consider modified or validated states as state transition will
# be handled by component_validation_workflow which will take care of
# updating the registry
if component.getValidationState() in ('modified', 'validated'):
version = component.getVersion(validated_only=True)
# The versions should have always been set on ERP5Site property
# beforehand
if version in version_priority_set:
reference = component.getReference(validated_only=True)
self.__registry_dict.setdefault(reference, {})[version] = component
try:
validation_state_tuple = component.getValidationState()
except AttributeError:
# XXX: Accessors may have not been generated yet
pass
else:
if validation_state_tuple in ('modified', 'validated'):
version = component.getVersion(validated_only=True)
# The versions should have always been set on ERP5Site property
# beforehand
if version in version_priority_set:
reference = component.getReference(validated_only=True)
self.__registry_dict.setdefault(reference, {})[version] = component
return self.__registry_dict
......
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