Skip to content

Commit

Permalink
fix import for plone.protect < 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Jul 10, 2018
1 parent 5c623c1 commit 694adf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ utf8-header = True
coverage = 4.0.3
python-coveralls = 2.7.0
setuptools = 33.1.1
six = 1.11.0
zc.buildout = 2.9.5
9 changes: 8 additions & 1 deletion src/collective/taxonomy/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from plone.dexterity.fti import DexterityFTIModificationDescription
from plone.dexterity.interfaces import IDexterityFTI
from plone.memoize import ram
from plone.protect.auto import safeWrite

from zope.interface import implementer
from zope.globalrequest import getRequest
Expand All @@ -34,6 +33,14 @@
NODE,
)

try:
from plone.protect.auto import safeWrite
except ImportError:
# plone.protect < 3.x compatibility
def safeWrite(obj, request):
pass


logger = logging.getLogger("collective.taxonomy")


Expand Down

0 comments on commit 694adf5

Please sign in to comment.