Commit 44efdd0e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Don't lookup ListBox_asHTML from portal object when result is not used.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36976 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4e991ee2
...@@ -2509,9 +2509,11 @@ class ListBoxHTMLRenderer(ListBoxRenderer): ...@@ -2509,9 +2509,11 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
return aq_base(getattr(self.getContext(), method_id)).__of__(context) return aq_base(getattr(self.getContext(), method_id)).__of__(context)
# Try to get a page template from acquisition context then portal object # Try to get a page template from acquisition context then portal object
# and fallback on default page template. # and fallback on default page template.
return getattr(self.getContext(), 'ListBox_asHTML', page_template = getattr(self.getContext(), 'ListBox_asHTML', None)
getattr(context.getPortalObject(), 'ListBox_asHTML', context.asHTML) if page_template is None:
).__of__(context) portal_object = context.getPortalObject()
page_template = getattr(portal_object, 'ListBox_asHTML', context.asHTML)
return page_template.__of__(context)
def render(self, **kw): def render(self, **kw):
"""Render the data in HTML. """Render the data in HTML.
......
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