[Erp5-report] r28858 - /erp5/trunk/products/ERP5/Document/WebSection.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 7 15:57:24 CEST 2009


Author: kazuhiko
Date: Mon Sep  7 15:57:21 2009
New Revision: 28858

URL: http://svn.erp5.org?rev=28858&view=rev
Log:
custom render method should be called on default document if exists.

Modified:
    erp5/trunk/products/ERP5/Document/WebSection.py

Modified: erp5/trunk/products/ERP5/Document/WebSection.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/WebSection.py?rev=28858&r1=28857&r2=28858&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSection.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/WebSection.py [utf8] Mon Sep  7 15:57:21 2009
@@ -174,10 +174,7 @@
         self.REQUEST[self.web_section_key] = self.getPhysicalPath()
       self.REQUEST.set('current_web_section', self)
       if not self.REQUEST.get('editable_mode') and not self.REQUEST.get('ignore_layout'):
-        # Try to use a custom renderer if any
-        custom_render_method_id = self.getCustomRenderMethodId()
-        if custom_render_method_id is not None:
-          return getattr(self, custom_render_method_id)()
+        document = None
         if self.isDefaultPageDisplayed():
           # The following could be moved to a typed based method for more flexibility
           document = self.getDefaultDocumentValue()
@@ -200,8 +197,15 @@
                 id=document.getReference(),
                 original_container=document.getParentValue(),
                 original_id=document.getId(),
-                editable_absolute_url=document.absolute_url()))
-            return document.__of__(self)()
+                editable_absolute_url=document.absolute_url())).__of__(self)
+        # Try to use a custom renderer if any
+        custom_render_method_id = self.getCustomRenderMethodId()
+        if custom_render_method_id is not None:
+          if document is None:
+            document = self
+          return getattr(document, custom_render_method_id)()
+        elif document is not None:
+          return document()
       return Domain.__call__(self)
 
     # Layout Selection API




More information about the Erp5-report mailing list