Commit 8040063c authored by Mame Coumba Sall's avatar Mame Coumba Sall

Fix http headers when use Custom Form Method

  Set http headers based on documents, because once you use Custom Method to
  render a Section or a front page we don't use document.__call__.
parent b99c9ba7
......@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from Products.CMFCore.utils import _setCacheHeaders, _ViewEmulator
from Products.ERP5.Document.Domain import Domain
from Products.ERP5.mixin.extensible_traversable import DocumentExtensibleTraversableMixin
from Acquisition import aq_base, aq_inner
......@@ -232,6 +233,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
if custom_render_method_id is not None:
if document is None:
document = self
_setCacheHeaders(_ViewEmulator().__of__(document), {})
return getattr(document, custom_render_method_id)()
elif document is not None:
return document()
......
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