Skip to content

Commit

Permalink
- fix up the template execution context for standard_error_message
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Apr 27, 2019
1 parent 2f1362d commit c3c37b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/OFS/browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
##############################################################################

from Acquisition import aq_parent
from Products.Five import BrowserView


Expand All @@ -21,7 +22,13 @@ class StandardErrorMessageView(BrowserView):
"""

def __call__(self):
root = self.request['PARENTS'][0]
published = getattr(self.request, 'PUBLISHED', None)
if published is not None:
root = aq_parent(published)
else:
root = self.request['PARENTS'][0]

return root.standard_error_message(
client=root,
error_type=self.context.__class__.__name__,
error_value=str(self.context))

0 comments on commit c3c37b9

Please sign in to comment.