Commit b8a18bed authored by Sebastien Robin's avatar Sebastien Robin

do not call directly setattr, this is better to use the default setProperty...

do not call directly setattr, this is better to use the default setProperty method wich can call setters if there are existing


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5021 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 01ee0a3c
......@@ -156,24 +156,24 @@ identify a bank account."""
result = None
return result
security.declareProtected( Permissions.ModifyPortalContent, '_setProperty' )
def _setProperty(self, key, value, type='string', **kw):
"""
Generic accessor. Calls the real accessor
**kw allows to call setProperty as a generic setter (ex. setProperty(value_uid, portal_type=))
"""
#try:
if 1:
# If mapped_value_attribute_list is not set
# then it creates an exception
if key in self.getMappedValuePropertyList([]):
return setattr(self, key, value)
#except:
# LOG("WARNING: ERP5", 0, 'Could not set mapped value property %s' % key)
# return
return Predicate._setProperty(self, key, value, type=type, **kw)
# security.declareProtected( Permissions.ModifyPortalContent, '_setProperty' )
# def _setProperty(self, key, value, type='string', **kw):
# """
# Generic accessor. Calls the real accessor
#
# **kw allows to call setProperty as a generic setter (ex. setProperty(value_uid, portal_type=))
# """
# #try:
# if 1:
# # If mapped_value_attribute_list is not set
# # then it creates an exception
# if key in self.getMappedValuePropertyList([]):
# return setattr(self, key, value)
# #except:
# # LOG("WARNING: ERP5", 0, 'Could not set mapped value property %s' % key)
# # return
#
# return Predicate._setProperty(self, key, value, type=type, **kw)
# Compatibility method
def getMappedValuePropertyList(self, *args):
......
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