Skip to content

Commit

Permalink
Do not execute integrity check for content types that are not related…
Browse files Browse the repository at this point in the history
… to this package.

This prevent issues with plone.app.iterate.
  • Loading branch information
mpeeters committed Apr 7, 2020
1 parent fb2683d commit 893f622
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changelog
1.31 (unreleased)
-----------------

- Nothing changed yet.
- Do not execute integrity check for content types that are not related to this package.
This prevent issues with plone.app.iterate.
[mpeeters]


1.30 (2020-02-06)
Expand Down
11 changes: 11 additions & 0 deletions src/collective/contact/core/subscribers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from Acquisition import aq_get
from collective.contact.core.behaviors import IContactDetails
from collective.contact.core.content.directory import IDirectory
from collective.contact.core.content.organization import IOrganization
from collective.contact.core.content.person import IPerson
from collective.contact.core.content.position import IPosition
Expand All @@ -16,6 +17,7 @@
from zc.relation.interfaces import ICatalog
from zope import component
from zope.container.contained import ContainerModifiedEvent
from zope.interface import providedBy
from zope.intid.interfaces import IIntIds
from zope.lifecycleevent.interfaces import IObjectAddedEvent
from zope.lifecycleevent.interfaces import IObjectModifiedEvent
Expand Down Expand Up @@ -115,6 +117,15 @@ def referenceRemoved(obj, event, toInterface=IContactContent):


def referencedObjectRemoved(obj, event):
allowed_interfaces = set([
IDirectory,
IOrganization,
IPerson,
IHeldPosition,
IPosition,
])
if len(allowed_interfaces.intersection([i for i in providedBy(obj)])) == 0:
return
# Avoid an error when we try to remove a working copy (plone.app.iterate)
if IWorkingCopy.providedBy(obj):
return
Expand Down

0 comments on commit 893f622

Please sign in to comment.