Commit 1afe5c08 authored by Łukasz Nowak's avatar Łukasz Nowak

Validate components only if possible.

parent c2411859
...@@ -4029,7 +4029,9 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem): ...@@ -4029,7 +4029,9 @@ class DocumentTemplateItem(FilesystemToZodbTemplateItem):
portal = context.getPortalObject() portal = context.getPortalObject()
for object_path in object_list: for object_path in object_list:
obj = portal.unrestrictedTraverse(object_path) obj = portal.unrestrictedTraverse(object_path)
obj.validate() if obj.getPortalObjec().portal_workflow.isTransitionPossible(obj,
'validate'):
obj.validate()
self.portal_components.reset(force=True, reset_portal_type=True) self.portal_components.reset(force=True, reset_portal_type=True)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment