[FIX] survey : restore debug mode for survey pages

During cleaning from ee2631cd51,
as the kwargs were removed from arguments for some routes,
debug mode was not accessible anymore as ?debug=x is, de facto,
a post argument.

This commit restores debug mode by restoring kwargs in those routes.

Fix commit from task ID 1911586 and PR #28986
Integrated in task ID 1911291 and PR #29054
This commit is contained in:
David Beguin
2019-01-17 09:49:50 +00:00
committed by Thibault Delavallée
parent 0e6d9863ec
commit 7dea1d7208
+4 -4
View File
@@ -139,7 +139,7 @@ class Survey(http.Controller):
return request.redirect('/survey/start/%s?token=%s' % (survey_sudo.id, answer_sudo.token))
@http.route('/survey/start/<int:survey_id>', type='http', auth='public', website=True)
def survey_start(self, survey_id, token=None, email=False):
def survey_start(self, survey_id, token=None, email=False, **post):
""" Start a survey by providing a token linked to an answer or generate
a new token if access is allowed """
access_data = self._get_access_data(survey_id, token, ensure_token=False)
@@ -170,7 +170,7 @@ class Survey(http.Controller):
return request.redirect('/survey/fill/%s/%s' % (survey_sudo.id, answer_sudo.token))
@http.route('/survey/fill/<int:survey_id>/<string:token>', type='http', auth='public', website=True)
def survey_display_page(self, survey_id, token, prev=None):
def survey_display_page(self, survey_id, token, prev=None, **post):
access_data = self._get_access_data(survey_id, token, ensure_token=True)
if access_data['validity_code'] is not True:
return self._redirect_with_error(access_data, access_data['validity_code'])
@@ -204,7 +204,7 @@ class Survey(http.Controller):
return request.render("survey.403", {'survey': survey_sudo})
@http.route('/survey/prefill/<int:survey_id>/<string:token>', type='http', auth='public', website=True)
def survey_get_answers(self, survey_id, token, page_id=None):
def survey_get_answers(self, survey_id, token, page_id=None, **post):
""" TDE NOTE: original comment: # AJAX prefilling of a survey -> AJAX / http ?? """
access_data = self._get_access_data(survey_id, token, ensure_token=True)
if access_data['validity_code'] is not True:
@@ -248,7 +248,7 @@ class Survey(http.Controller):
return json.dumps(ret, default=str)
@http.route('/survey/scores/<int:survey_id>/<string:token>', type='http', auth='public', website=True)
def survey_get_scores(self, survey_id, token, page_id=None):
def survey_get_scores(self, survey_id, token, page_id=None, **post):
""" TDE NOTE: original comment: # AJAX scores loading for quiz correction mode -> AJAX / http ?? """
access_data = self._get_access_data(survey_id, token, ensure_token=True)
if access_data['validity_code'] is not True: