Commit 0a285206 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix hasErrorMessageList() of ZODB Component as error_message...

Fix hasErrorMessageList() of ZODB Component as error_message (component_validation_workflow variable) is always set.
parent ed0a92be
......@@ -251,11 +251,8 @@ class ComponentMixin(PropertyRecordableMixin, Base):
Check whether there are error messages, useful to display errors in the UI
without calling getErrorMessageList() which translates error messages
"""
try:
self.workflow_history['component_validation_workflow'][-1]['error_message']
return True
except KeyError:
return False
workflow = self.workflow_history['component_validation_workflow'][-1]
return bool(workflow['error_message'])
security.declareProtected(Permissions.AccessContentsInformation,
'getErrorMessageList')
......
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