Commit 999e908f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use getattr instead of hasattr.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14438 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad530e19
......@@ -471,10 +471,10 @@ class Predicate(XMLObject, Folder):
new_criterion_property_list.append(property)
property_min = property + '_range_min'
property_max = property + '_range_max'
if hasattr(self,'get%s' % convertToUpperCase(property)) \
if getattr(self, 'get%s' % convertToUpperCase(property), None) is not None\
and self.getProperty(property) is not None:
identity_criterion[property] = self.getProperty(property)
elif hasattr(self,'get%s' % convertToUpperCase(property_min)):
elif getattr(self, 'get%s' % convertToUpperCase(property_min), None) is not None:
min = self.getProperty(property_min)
max = self.getProperty(property_max)
range_criterion[property] = (min,max)
......
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