Skip to content

Commit

Permalink
fix: Fix error when Plone site is not yet set as in first index_html …
Browse files Browse the repository at this point in the history
…call on Zope.
  • Loading branch information
bsuttor committed Nov 27, 2024
1 parent d022ba5 commit fb740c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Changes
=======

2.1 (unreleased)
2.0.1 (unreleased)
----------------

- Nothing changed yet.
- Fix error when Plone site is not yet set as in first index_html call on Zope.
[bsuttor]


2.0 (2023-05-04)
Expand Down
3 changes: 2 additions & 1 deletion src/z3c/jbot/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

try:
import Acquisition # noqa
import Zope2 # noqa
ZOPE_3 = False
except ImportError:
ZOPE_3 = True
Expand All @@ -24,7 +25,7 @@ def getRequest():
try:
return site.request
except AttributeError:
return site.REQUEST
return getattr(site, "REQUEST", Zope2.app().REQUEST)

try:
i = zope.security.management.getInteraction()
Expand Down

0 comments on commit fb740c3

Please sign in to comment.