[Erp5-report] r42009 kazuhiko - /erp5/trunk/products/ERP5/mixin/discoverable.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jan 4 18:35:46 CET 2011
Author: kazuhiko
Date: Tue Jan 4 18:35:46 2011
New Revision: 42009
URL: http://svn.erp5.org?rev=42009&view=rev
Log:
exception should not be raised in converting to HTML inside getContentInformation().
Modified:
erp5/trunk/products/ERP5/mixin/discoverable.py
Modified: erp5/trunk/products/ERP5/mixin/discoverable.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/mixin/discoverable.py?rev=42009&r1=42008&r2=42009&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/mixin/discoverable.py [utf8] (original)
+++ erp5/trunk/products/ERP5/mixin/discoverable.py [utf8] Tue Jan 4 18:35:46 2011
@@ -28,6 +28,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo, getSecurityManager
+from ZODB.POSException import ConflictError
from Products.ERP5Type import Permissions
from Products.ERP5Type.Utils import convertToUpperCase
from Products.CMFCore.utils import getToolByName
@@ -45,6 +46,8 @@ VALID_ORDER_KEY_LIST = ('user_login', 'c
CONTENT_INFORMATION_FORMAT = '_idiscoverable_content_information'
+class ConversionError(Exception):pass
+
class DiscoverableMixin(CachedConvertableMixin):
"""
Implements IDiscoverable
@@ -261,7 +264,12 @@ class DiscoverableMixin(CachedConvertabl
the document title.
"""
result = {}
- html = self.asEntireHTML()
+ try:
+ html = self.asEntireHTML()
+ except ConflictError:
+ raise
+ except:
+ return result
if not html:
return result
title_list = re.findall(self.title_parser, str(html))
More information about the Erp5-report
mailing list