diff options
| author | Aurélien Warnon <awa@odoo.com> | 2020-02-04 07:36:08 +0000 |
|---|---|---|
| committer | Aurélien Warnon <awa@odoo.com> | 2020-02-04 07:37:26 +0000 |
| commit | 774d43c49f30e13e64b4bacfe735cc64c5821686 (patch) | |
| tree | dcba793576e1a76b8ce6cbf8b31553d0d1684feb /addons | |
| parent | 16c41832a3e174412873860c25ae2a8c8d8ae190 (diff) | |
[REF] survey: clean useless .decode('utf-8') calls
This commit cleans some useless .decode('utf-8') calls when we return rendered
templates results in the survey controllers.
The http module is capable of handling that type of results and the calls were
not necessary / added complexity.
Task '2187328'
closes odoo/odoo#44540
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/survey/controllers/main.py | 4 | ||||
| -rw-r--r-- | addons/survey/controllers/survey_session_manage.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index 7f512549c72..b34ffda375e 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -329,8 +329,8 @@ class Survey(http.Controller): and send back this html to the survey_form widget that will inject it into the page.""" data = self._prepare_survey_data(survey_sudo, answer_sudo, **post) if answer_sudo.state == 'done': - return request.env.ref('survey.survey_fill_form_done').render(data).decode('UTF-8') - return request.env.ref('survey.survey_fill_form_in_progress').render(data).decode('UTF-8') + return request.env.ref('survey.survey_fill_form_done').render(data) + return request.env.ref('survey.survey_fill_form_in_progress').render(data) @http.route('/survey/<string:survey_token>/<string:answer_token>', type='http', auth='public', website=True) def survey_display_page(self, survey_token, answer_token, **post): diff --git a/addons/survey/controllers/survey_session_manage.py b/addons/survey/controllers/survey_session_manage.py index e245d11665a..8f5f32f60f1 100644 --- a/addons/survey/controllers/survey_session_manage.py +++ b/addons/survey/controllers/survey_session_manage.py @@ -58,7 +58,7 @@ class UserInputSession(http.Controller): survey._session_trigger_next_question() template_values = self._prepare_manage_session_values(survey) template_values['is_rpc_call'] = True - return request.env.ref('survey.user_input_session_manage_content').render(template_values).decode('UTF-8') + return request.env.ref('survey.user_input_session_manage_content').render(template_values) @http.route('/survey/session/results/<string:survey_token>', type='json', auth='user', website=True) def survey_session_results(self, survey_token, **kwargs): @@ -86,7 +86,7 @@ class UserInputSession(http.Controller): 'survey': survey, 'question': survey.session_question_id, 'question_data': question_statistics, - }).decode('UTF-8') + }) @http.route('/survey/session/ranking/<string:survey_token>', type='json', auth='user', website=True) def survey_session_ranking(self, survey_token, **kwargs): @@ -104,7 +104,7 @@ class UserInputSession(http.Controller): return request.env.ref('survey.user_input_session_ranking').render({ 'animate_width': True, 'ranking': survey._prepare_ranking_values() - }).decode('UTF-8') + }) def _prepare_manage_session_values(self, survey): is_last_question = False |
