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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 13 11:37:08 CET 2011


Author: nicolas
Date: Thu Jan 13 11:37:08 2011
New Revision: 42296

URL: http://svn.erp5.org?rev=42296&view=rev
Log:
As getBody always returns empty string by default.
edit(body=None) will try to update the _body attribute and fails.
Force conversion from None to empty string to authorise edit of Python Script documents
without content in my_body field.

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

Modified: erp5/trunk/products/ERP5/Document/PythonScript.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PythonScript.py?rev=42296&r1=42295&r2=42296&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PythonScript.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PythonScript.py [utf8] Thu Jan 13 11:37:08 2011
@@ -96,6 +96,8 @@ class PythonScript(XMLObject, ZopePython
       """
       override to call ZopePythonScript methods to initialize code
       """
+      if value is None:
+        value = ''
       self.write(value)
 
     def _setParameterSignature(self, value):



More information about the Erp5-report mailing list