From 73c27bfc6ec10fc9e8dd149c128a627202d4f452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Thu, 29 Nov 2007 09:24:36 +0000 Subject: [PATCH] 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 --- product/ERP5Type/TranslationProviderBase.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/product/ERP5Type/TranslationProviderBase.py b/product/ERP5Type/TranslationProviderBase.py index f6e89dba57..88add9dad2 100644 --- a/product/ERP5Type/TranslationProviderBase.py +++ b/product/ERP5Type/TranslationProviderBase.py @@ -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,): -- 2.30.9