Commit e0d31cba authored by Jérome Perrin's avatar Jérome Perrin

core: set a status message when errors found after editing component

parent d672defe
from Products.ERP5Type.Message import translateString
obj = state_change['object']
request = container.REQUEST
error_list = []
warning_list = []
......@@ -13,6 +15,12 @@ for message_dict in obj.checkSourceCode():
else:
warning_list.append(message)
if warning_list or error_list:
request.set(
'portal_status_message',
translateString("Errors found in source code."))
request.set('portal_status_level', 'error')
obj.setTextContentWarningMessageList(warning_list)
obj.setTextContentErrorMessageList(error_list)
......
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