From a602bc59b97dc309234562a261cb11a5f48ba8d0 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 10 Nov 2023 22:35:10 +0100 Subject: [PATCH] Fix DeprecationWarning: import IObjectAddedEvent from zope.lifecycleevent. --- CHANGES.rst | 4 +++- src/Products/CMFUid/UniqueIdAnnotationTool.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1222153..342a020 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,11 +4,13 @@ Products.CMFUid Changelog 4.2 (unreleased) ---------------- +- Fix ``DeprecationWarning``: import ``IObjectAddedEvent`` from ``zope.lifecycleevent``. + 4.1 (2023-10-02) ---------------- -- Modified the code of ``handleUidAnnotationEvent`` to check if both the +- Modified the code of ``handleUidAnnotationEvent`` to check if both the annotation tool and the UID tool exist before using them. This change ensures that the code won't run unless both tools are available. diff --git a/src/Products/CMFUid/UniqueIdAnnotationTool.py b/src/Products/CMFUid/UniqueIdAnnotationTool.py index b1f676b..374855a 100644 --- a/src/Products/CMFUid/UniqueIdAnnotationTool.py +++ b/src/Products/CMFUid/UniqueIdAnnotationTool.py @@ -23,8 +23,8 @@ from OFS.SimpleItem import SimpleItem from Persistence import Persistent from zope.component import queryUtility -from zope.container.interfaces import IObjectAddedEvent from zope.interface import implementer +from zope.lifecycleevent.interfaces import IObjectAddedEvent from Products.CMFCore.utils import UniqueObject from Products.CMFCore.utils import getToolByName