Skip to content

Commit

Permalink
[FIX] website_mail : prevent posting empty comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jem-odoo committed Sep 23, 2015
1 parent 04400f8 commit 6ed93f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions addons/website_mail/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,8 @@ def chatter_json(self, res_model='', res_id=None, message='', **kw):
@http.route(['/website_mail/post/post'], type='http', method=['POST'], auth='public', website=True)
def chatter_post(self, res_model='', res_id=None, message='', redirect=None, **kw):
res_id = int(res_id)
message = _message_post_helper(res_model, res_id, message, **kw)
return request.redirect(request.httprequest.referrer + "#message-%s" % (message.id,))
url = request.httprequest.referrer
if message:
message = _message_post_helper(res_model, res_id, message, **kw)
url = url + "#message-%s" % (message.id,)
return request.redirect(url)
1 change: 0 additions & 1 deletion addons/website_sale/controllers/website_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def chatter_post(self, res_model='', res_id=None, message='', redirect=None, **k
'res_id': res_id,
'message_id': message_id,
})
print rating
except Exception:
pass
return response

0 comments on commit 6ed93f1

Please sign in to comment.