Skip to content

Commit 8672ddc

Browse files
explicitacquisition: just copy the code from CMFPlone master.
1 parent ecdccb2 commit 8672ddc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Products/CMFPlone/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99

1010
__version__ = pkg_resources.require("Products.CMFPlone")[0].version
1111

12-
if __version__ < '7':
13-
from Products.CMFCore import explicitacquisition
14-
PTA_ENV_KEY = explicitacquisition.PTA_ENV_KEY
15-
os.environ[PTA_ENV_KEY] = os.environ.get(PTA_ENV_KEY, 'false')
16-
explicitacquisition.SKIP_PTA = os.environ.get(PTA_ENV_KEY, "true") == "false"
12+
if __version__ < "7":
13+
# This sets SKIP_PTA to skip the check for
14+
# Publication through acquisition in Plone 6.
15+
# Please remove this code block when can.
16+
import Products.CMFCore.explicitacquisition
17+
from Products.CMFCore.explicitacquisition import PTA_ENV_KEY
18+
19+
os.environ[PTA_ENV_KEY] = os.environ.get(PTA_ENV_KEY, "false")
20+
# Importing (from) the module sets SKIP_PTA. We need to override that too.
21+
Products.CMFCore.explicitacquisition.SKIP_PTA = os.environ[PTA_ENV_KEY] == "false"
1722

1823
cmfplone_globals = globals()
1924
this_module = sys.modules[__name__]

0 commit comments

Comments
 (0)