--- a/src/pyams_content/shared/common/__init__.py Tue Feb 20 11:08:41 2018 +0100
+++ b/src/pyams_content/shared/common/__init__.py Tue Feb 20 11:17:11 2018 +0100
@@ -160,15 +160,19 @@
request = query_request()
if request is not None:
content = event.object
- principal_id = request.principal.id
- modifiers = content.modifiers or set()
- if principal_id not in modifiers:
- modifiers.add(principal_id)
- content.modifiers = modifiers
- catalog = query_utility(ICatalog)
- intids = query_utility(IIntIds)
- catalog['modifiers'].reindex_doc(intids.register(content), content)
- content.last_modifier = principal_id
+ try:
+ principal_id = request.principal.id
+ except AttributeError:
+ pass
+ else:
+ modifiers = content.modifiers or set()
+ if principal_id not in modifiers:
+ modifiers.add(principal_id)
+ content.modifiers = modifiers
+ catalog = query_utility(ICatalog)
+ intids = query_utility(IIntIds)
+ catalog['modifiers'].reindex_doc(intids.register(content), content)
+ content.last_modifier = principal_id
@subscriber(IObjectClonedEvent, context_selector=IWfSharedContent)