[Erp5-report] r36976 gregory - /erp5/trunk/products/ERP5Form/ListBox.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jul 8 12:09:08 CEST 2010
Author: gregory
Date: Thu Jul 8 12:09:06 2010
New Revision: 36976
URL: http://svn.erp5.org?rev=36976&view=rev
Log:
Don't lookup ListBox_asHTML from portal object when result is not used.
Modified:
erp5/trunk/products/ERP5Form/ListBox.py
Modified: erp5/trunk/products/ERP5Form/ListBox.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ListBox.py?rev=36976&r1=36975&r2=36976&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py [utf8] Thu Jul 8 12:09:06 2010
@@ -2509,9 +2509,11 @@ class ListBoxHTMLRenderer(ListBoxRendere
return aq_base(getattr(self.getContext(), method_id)).__of__(context)
# Try to get a page template from acquisition context then portal object
# and fallback on default page template.
- return getattr(self.getContext(), 'ListBox_asHTML',
- getattr(context.getPortalObject(), 'ListBox_asHTML', context.asHTML)
- ).__of__(context)
+ page_template = getattr(self.getContext(), 'ListBox_asHTML', None)
+ if page_template is None:
+ portal_object = context.getPortalObject()
+ page_template = getattr(portal_object, 'ListBox_asHTML', context.asHTML)
+ return page_template.__of__(context)
def render(self, **kw):
"""Render the data in HTML.
More information about the Erp5-report
mailing list