diff --git a/collective/auditlog/action.py b/collective/auditlog/action.py index 10f4e42..479c71e 100644 --- a/collective/auditlog/action.py +++ b/collective/auditlog/action.py @@ -11,6 +11,11 @@ except ImportError: class IPloneFormGenField(Interface): pass +try: + from ploneintranet.workspace.interfaces import IWorkspaceCreatedFromTemplateEvent # noqa: E501 +except ImportError: + class IWorkspaceCreatedFromTemplateEvent(Interface): + pass from Products.Archetypes.interfaces import ( IObjectInitializedEvent, IObjectEditedEvent, IBaseObject) @@ -120,7 +125,8 @@ def __call__(self): action = 'removed' elif (IObjectInitializedEvent.providedBy(event) or IObjectCreatedEvent.providedBy(event) or - IObjectAddedEvent.providedBy(event)): + IObjectAddedEvent.providedBy(event) or + IWorkspaceCreatedFromTemplateEvent.providedBy(event)): action = 'added' elif IObjectMovedEvent.providedBy(event): # moves can also be renames. Check the parent object diff --git a/docs/HISTORY.rst b/docs/HISTORY.rst index 177eb95..b323c58 100644 --- a/docs/HISTORY.rst +++ b/docs/HISTORY.rst @@ -4,7 +4,8 @@ Changelog 1.3.4 (unreleased) ------------------ -- Nothing changed yet. +- Handle IWorkspaceCreatedFromTemplateEvent. + [reinhardt] 1.3.3 (2018-07-12)