Commit 73c27bfc authored by Jérome Perrin's avatar Jérome Perrin

updateInitialPropertyTranslationDomainDict should always initialize

_property_domain_dict on the first call.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17891 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 482ff80d
......@@ -85,17 +85,21 @@ class TranslationProviderBase:
domain_name = prop.get('translation_domain', None)
property_domain_dict[prop_id] = TranslationInformation(prop_id, domain_name)
original_property_domain_dict = getattr(aq_base(self), '_property_domain_dict', {})
original_property_domain_dict = getattr(aq_base(self),
'_property_domain_dict', _MARKER)
original_property_domain_keys = original_property_domain_dict.keys()
property_domain_keys = property_domain_dict.keys()
property_domain_keys.sort()
original_property_domain_keys.sort()
# Only update if required in order to prevent ZODB from growing
if property_domain_keys != original_property_domain_keys:
if original_property_domain_dict is _MARKER or\
property_domain_keys != original_property_domain_keys:
# Update existing dict
property_domain_dict.update(original_property_domain_dict)
# And store
self._property_domain_dict = property_domain_dict
security.declarePrivate( 'getPropertyTranslationDomainDict' )
def getPropertyTranslationDomainDict(self,):
......
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