diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index 553fc5ad4b22cbbeadbe6e8e76d78a025dda38ad..331b8a8642ccc129b7b833348e4626bd2f397ade 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -252,6 +252,10 @@ class WebsiteSurvey(http.Controller): def print_survey(self, survey, token=None, **post): '''Display an survey in printable view; if <token> is set, it will grab the answers of the user_input_id that has <token>.''' + + if survey.auth_required and request.env.user == request.website.user_id: + return request.render("survey.auth_required", {'survey': survey, 'token': token}) + return request.render('survey.survey_print', {'survey': survey, 'token': token,