Commit 581f57f1 authored by Jim Fulton's avatar Jim Fulton

Changed to handle non-string returns.

parent bb02363e
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""DTML Document objects.""" """DTML Document objects."""
__version__='$Revision: 1.26 $'[11:-2] __version__='$Revision: 1.27 $'[11:-2]
from DocumentTemplate.DT_Util import InstanceDict, TemplateDict from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
from ZPublisher.Converters import type_converters from ZPublisher.Converters import type_converters
from Globals import HTML, HTMLFile, MessageDialog from Globals import HTML, HTMLFile, MessageDialog
...@@ -161,7 +161,9 @@ class DTMLDocument(DTMLMethod, PropertyManager): ...@@ -161,7 +161,9 @@ class DTMLDocument(DTMLMethod, PropertyManager):
r=apply(HTML.__call__, (self, bself, REQUEST), kw) r=apply(HTML.__call__, (self, bself, REQUEST), kw)
if RESPONSE is None: return r if RESPONSE is None: return r
return decapitate(r, RESPONSE) return decapitate(r, RESPONSE)
try: r=apply(HTML.__call__, (self, (client, bself), REQUEST), kw) try:
r=apply(HTML.__call__, (self, (client, bself), REQUEST), kw)
if type(r) is not type(''): return r
except: except:
if self.id()=='standard_error_message': if self.id()=='standard_error_message':
raise sys.exc_type, sys.exc_value, sys.exc_traceback raise sys.exc_type, sys.exc_value, sys.exc_traceback
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""DTML Method objects.""" """DTML Method objects."""
__version__='$Revision: 1.26 $'[11:-2] __version__='$Revision: 1.27 $'[11:-2]
from Globals import HTML, HTMLFile, MessageDialog from Globals import HTML, HTMLFile, MessageDialog
from string import join,split,strip,rfind,atoi,lower from string import join,split,strip,rfind,atoi,lower
...@@ -141,12 +141,16 @@ class DTMLMethod(cDocument, HTML, Acquisition.Implicit, RoleManager, ...@@ -141,12 +141,16 @@ class DTMLMethod(cDocument, HTML, Acquisition.Implicit, RoleManager,
if RESPONSE is None: return r if RESPONSE is None: return r
return decapitate(r, RESPONSE) return decapitate(r, RESPONSE)
try: r=apply(HTML.__call__, (self, client, REQUEST), kw) try:
r=apply(HTML.__call__, (self, client, REQUEST), kw)
if type(r) is not type(''): return r
except: except:
if self.id()=='standard_error_message': if self.id()=='standard_error_message':
raise sys.exc_type, sys.exc_value, sys.exc_traceback raise sys.exc_type, sys.exc_value, sys.exc_traceback
return self.raise_standardErrorMessage(client, REQUEST) return self.raise_standardErrorMessage(client, REQUEST)
if RESPONSE is None: return r if RESPONSE is None: return r
# Ick. I don't like this. But someone can override it with # Ick. I don't like this. But someone can override it with
......
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