Commit d076553e authored by Sebastien Robin's avatar Sebastien Robin

override pt_render to allow empty strings

parent c821eb3b
...@@ -11,6 +11,7 @@ from AccessControl import getSecurityManager ...@@ -11,6 +11,7 @@ from AccessControl import getSecurityManager
from App.class_init import default__class_init__ as InitializeClass from App.class_init import default__class_init__ as InitializeClass
from App.Common import package_home from App.Common import package_home
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
from Products.PageTemplates.PageTemplate import PageTemplate
from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from BaseMailTemplate import BaseMailTemplate from BaseMailTemplate import BaseMailTemplate
...@@ -93,6 +94,12 @@ class MailTemplate(BaseMailTemplate,ZopePageTemplate): ...@@ -93,6 +94,12 @@ class MailTemplate(BaseMailTemplate,ZopePageTemplate):
finally: finally:
security.removeContext(self) security.removeContext(self)
def pt_render(self, source=False, extra_context={}):
# Override to support empty strings
result = PageTemplate.pt_render(self, source, extra_context) or u''
assert isinstance(result, unicode)
return result
InitializeClass(MailTemplate) InitializeClass(MailTemplate)
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