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