DiscussionThreadModule_addReply.py 457 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
person = context.ERP5Site_getAuthenticatedMemberPersonValue

discussion_post = context.newContent(
    title=title,
    text_content=text_content,
    source_value=person,
    portal_type='Discussion Post'
)
if batch_mode:
  return discussion_post

translateString = context.Base_translateString

portal_status_message = translateString('New reply created.')
context.Base_redirect('view',
    keep_items = dict(portal_status_message=portal_status_message))