Commit a93616d1 authored by Jérome Perrin's avatar Jérome Perrin

Content Setters should use _getOb when checking if subcontent exists, not

getattr, because we do not want to modify an acquired object.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10793 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca6f60c6
......@@ -154,7 +154,7 @@ class Setter(Method):
def __call__(self, instance, value, *args, **kw):
from Products.ERP5Type.Utils import assertAttributePortalType
assertAttributePortalType(instance, self._storage_id, self._portal_type)
o = getattr(instance, self._storage_id, None)
o = instance._getOb(self._storage_id, None)
if o is None:
o = instance.newContent(id = self._storage_id, portal_type = self._portal_type[0])
if self._reindex:
......
......@@ -208,7 +208,7 @@ class Setter(Method):
o = None
available_id = None
for k in self._storage_id_list:
o = getattr(instance, k, None)
o = instance._getOb(k, None)
if o is None: available_id = k
if o is not None and o.portal_type in self._portal_type:
if self._reindex:
......
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