Skip to content
Snippets Groups Projects
Commit 4c030311 authored by Kevin Baptiste's avatar Kevin Baptiste
Browse files

[FIX] ratings: properly convert rating


closes odoo/odoo#40853

Taskid: 2145481
Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
parent 8c164109
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ class Rating(http.Controller):
@http.route(['/rating/<string:token>/submit_feedback'], type="http", auth="public", methods=['post'], website=True)
def submit_rating(self, token, **kwargs):
rate = kwargs.get('rate')
rate = int(kwargs.get('rate'))
assert rate in (1, 5, 10), "Incorrect rating"
rating = request.env['rating.rating'].sudo().search([('access_token', '=', token)])
if not rating:
......
......@@ -25,7 +25,7 @@
<div class="btn-group btn-group-toggle row" data-toggle="buttons">
<t t-foreach="rate_names" t-as="rate_name">
<label t-attf-class="col-xs-12 btn o_rating_label shadow-none {{rate == rate_name and 'active' or ''}}">
<input type="radio" name="rate" t-attf-id="rate_{{rate_name}}" t-att-value="rate_name"/>
<input type="radio" name="rate" t-attf-id="rate_{{rate_name}}" t-att-value="rate_name" t-att-checked="rate == rate_name"/>
<a class="o_rating" href="#">
<img t-attf-src='/rating/static/src/img/rating_#{rate_name}.png' t-att-alt="rate_name_value" t-att-title="rate_name_value"/>
</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment