Commit d08599fe authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

return None instead of calling str() if _baseGet*()'s value is None in...

return None instead of calling str() if _baseGet*()'s value is None in getBaseData() and getData(). thanks to Romain for reporting the bug.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28361 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5af3aed2
...@@ -1392,7 +1392,11 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, Sna ...@@ -1392,7 +1392,11 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, Sna
'getBaseData') 'getBaseData')
def getBaseData(self, default=None): def getBaseData(self, default=None):
"""return BaseData as str.""" """return BaseData as str."""
return str(self._baseGetBaseData()) base_data = self._baseGetBaseData()
if base_data is None:
return None
else:
return str(base_data)
security.declareProtected(Permissions.ModifyPortalContent, '_setData') security.declareProtected(Permissions.ModifyPortalContent, '_setData')
def _setData(self, data): def _setData(self, data):
...@@ -1401,4 +1405,8 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, Sna ...@@ -1401,4 +1405,8 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, Sna
security.declareProtected(Permissions.AccessContentsInformation, 'getData') security.declareProtected(Permissions.AccessContentsInformation, 'getData')
def getData(self, default=None): def getData(self, default=None):
"""return Data as str.""" """return Data as str."""
return str(self._baseGetData()) data = self._baseGetData()
if data is None:
return None
else:
return str(data)
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