From 1dda0455403766338dba4ad5f9a8ef3d2cb192a5 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Thu, 13 Jan 2011 10:37:08 +0000
Subject: [PATCH] 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.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42296 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/PythonScript.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5/Document/PythonScript.py b/product/ERP5/Document/PythonScript.py
index 01a680e9ec..b8b7ac4b05 100644
--- a/product/ERP5/Document/PythonScript.py
+++ b/product/ERP5/Document/PythonScript.py
@@ -96,6 +96,8 @@ class PythonScript(XMLObject, ZopePythonScript):
       """
       override to call ZopePythonScript methods to initialize code
       """
+      if value is None:
+        value = ''
       self.write(value)
 
     def _setParameterSignature(self, value):
-- 
2.30.9