[FIX] portal: don't crash in chatter_post if no attachments
Default value for attachment_ids / tokens is None. However a check method consider those as lists and check their length. When calling chatter_post without giving at least a void list there is therefore a crash that can be easily avoided. closes odoo/odoo#94695 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -131,7 +131,7 @@ class PortalChatter(http.Controller):
|
||||
|
||||
res_id = int(res_id)
|
||||
|
||||
self._portal_post_check_attachments(attachment_ids, attachment_tokens)
|
||||
self._portal_post_check_attachments(attachment_ids or [], attachment_tokens or [])
|
||||
|
||||
result = {'default_message': message}
|
||||
# message is received in plaintext and saved in html
|
||||
|
||||
Reference in New Issue
Block a user