Commit cf3c14b6 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_base: use type based method to retrieve method to create posts

parent b44378ea
......@@ -29,7 +29,7 @@ mail_message = portal.Base_createMailMessageAsString(
embedded_file_list=embedded_file_list,
extra_header_dict=extra_header_dict)
create_post_message_method = getattr(event, 'Event_createPostMessage', None)
create_post_message_method = event.getTypeBasedMethod('createPostMessage')
if create_post_message_method:
create_post_message_method(mail_message)
else:
......
......@@ -48,7 +48,7 @@ if not context.hasStartDate():
if download or not use_activity:
create_post_message_method = getattr(context, 'Event_createPostMessage', None)
create_post_message_method = context.getTypeBasedMethod('createPostMessage')
for to_url in to_url_list:
body = body or context.getTextContent() or ''
......
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