# HG changeset patch # User Thierry Florac # Date 1510311364 -3600 # Node ID 38133975088e3cec24bc033017c0927e39bcf814 # Parent eadd658a8416cdbc9b5e24d9bb0a2b3b2641adff Updated subscribers interface diff -r eadd658a8416 -r 38133975088e src/pyams_content/component/association/__init__.py --- a/src/pyams_content/component/association/__init__.py Fri Nov 10 11:55:35 2017 +0100 +++ b/src/pyams_content/component/association/__init__.py Fri Nov 10 11:56:04 2017 +0100 @@ -16,8 +16,7 @@ # import standard library # import interfaces -from pyams_content.component.association.interfaces import IAssociationItem -from pyams_content.shared.common.interfaces import IWfSharedContent +from pyams_content.component.association.interfaces import IAssociationItem, IAssociationTarget from pyams_form.interfaces.form import IFormContextPermissionChecker from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent, IObjectRemovedEvent @@ -53,14 +52,14 @@ @property def edit_permission(self): - content = get_parent(self.context, IWfSharedContent) + content = get_parent(self.context, IAssociationTarget) return IFormContextPermissionChecker(content).edit_permission @subscriber(IObjectAddedEvent, context_selector=IAssociationItem) def handle_added_association(event): """Handle added association item""" - content = get_parent(event.object, IWfSharedContent) + content = get_parent(event.object, IAssociationTarget) if content is not None: get_current_registry().notify(ObjectModifiedEvent(content)) @@ -68,7 +67,7 @@ @subscriber(IObjectModifiedEvent, context_selector=IAssociationItem) def handle_modified_association(event): """Handle modified association item""" - content = get_parent(event.object, IWfSharedContent) + content = get_parent(event.object, IAssociationTarget) if content is not None: get_current_registry().notify(ObjectModifiedEvent(content)) @@ -76,6 +75,6 @@ @subscriber(IObjectRemovedEvent, context_selector=IAssociationItem) def handle_removed_association(event): """Handle removed association item""" - content = get_parent(event.object, IWfSharedContent) + content = get_parent(event.object, IAssociationTarget) if content is not None: get_current_registry().notify(ObjectModifiedEvent(content))