[Erp5-report] r8840 - /erp5/trunk/products/CMFCategory/CategoryTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jul 27 17:18:43 CEST 2006


Author: jerome
Date: Thu Jul 27 17:18:41 2006
New Revision: 8840

URL: http://svn.erp5.org?rev=8840&view=rev
Log:
use getattr instead of hasattr to make sure we don't ignore ConflictErrors

Modified:
    erp5/trunk/products/CMFCategory/CategoryTool.py

Modified: erp5/trunk/products/CMFCategory/CategoryTool.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFCategory/CategoryTool.py?rev=8840&r1=8839&r2=8840&view=diff
==============================================================================
--- erp5/trunk/products/CMFCategory/CategoryTool.py (original)
+++ erp5/trunk/products/CMFCategory/CategoryTool.py Thu Jul 27 17:18:41 2006
@@ -1229,7 +1229,8 @@
             category_list += [new_category]
           self._setCategoryList(o, category_list)
 
-          if hasattr(aq_base(o), 'notifyAfterUpdateRelatedContent'):
+          if getattr(aq_base(o),
+                    'notifyAfterUpdateRelatedContent', None) is not None:
             o.notifyAfterUpdateRelatedContent(previous_category_url,
                                               new_category_url)
 
@@ -1239,7 +1240,7 @@
 
       aq_context = aq_base(context)
       # Update related recursively if required
-      if hasattr(aq_context, 'listFolderContents'):
+      if getattr(aq_context, 'listFolderContents', None) is not None:
         for o in context.listFolderContents():
           new_o_category_url = o.getRelativeUrl()
           # Relative Url is based on parent new_category_url so we must




More information about the Erp5-report mailing list