[Erp5-report] r35219 nicolas - /erp5/trunk/products/ERP5/Document/Document.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed May 12 15:42:32 CEST 2010


Author: nicolas
Date: Wed May 12 15:42:27 2010
New Revision: 35219

URL: http://svn.erp5.org?rev=35219&view=rev
Log:
small improvement to avoid usage of hasattr

Modified:
    erp5/trunk/products/ERP5/Document/Document.py

Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=35219&r1=35218&r2=35219&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Wed May 12 15:42:27 2010
@@ -995,9 +995,9 @@
       set on the document by ContributionTool.newContent as soon
       as the document was created.
     """
-    if hasattr(self, '_backup_input'):
-      return getattr(self, '_backup_input')
-    kw = {}
+    kw = getattr(self, '_backup_input', {})
+    if kw:
+      return kw
     for id in self.propertyIds():
       # We should not consider file data
       if id not in ('data', 'categories_list', 'uid', 'id',




More information about the Erp5-report mailing list