Commit 501a852f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Stop rewriting _identity_criterion and _range_criterion unnecessarily. This...

Stop rewriting _identity_criterion and _range_criterion unnecessarily. This caused a lot of conflicts only by viewing objects.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37425 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 198bbea8
......@@ -543,8 +543,21 @@ class Predicate(XMLObject):
new_membership_criterion_base_category_list.append(base_category)
new_criterion_property_list = list(self.getCriterionPropertyList())
identity_criterion = getattr(self,'_identity_criterion',{})
range_criterion = getattr(self,'_range_criterion',{})
# We need to build new criteria for asContext, and we should not
# modify the original, so we always make copies. Since the usage is
# temporary, use dicts instead of persistent mappings.
identity_criterion = getattr(self, '_identity_criterion', None)
if identity_criterion is None:
identity_criterion = {}
else:
identity_criterion = dict(identity_criterion)
range_criterion = getattr(self, '_range_criterion', None)
if range_criterion is None:
range_criterion = {}
else:
range_criterion = dict(range_criterion)
# Look at local properties and make it criterion properties
for property in criterion_property_list:
if property not in self.getCriterionPropertyList() \
......
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