Skip to content

Commit

Permalink
Merge branch 'master' into issue_562
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Apr 27, 2019
2 parents a66a549 + 0112094 commit a1be29e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/OFS/browser/__init__.py
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))
1 change: 1 addition & 0 deletions src/Testing/utils.py
Expand Up @@ -15,6 +15,7 @@
import contextlib
import sys


@contextlib.contextmanager
def capture_stdout(file):
old_out = sys.stdout
Expand Down

0 comments on commit a1be29e

Please sign in to comment.