[MIG] survey_extra_fields, survey_base : modifications to make them work in v18

This commit is contained in:
2026-06-10 16:56:56 +02:00
parent 8f235646ef
commit 8a2075a3db
10 changed files with 194 additions and 182 deletions

View File

@@ -31,7 +31,7 @@ class SurveyExtraFieldsController(Survey):
[("access_token", "=", survey_token)], limit=1
)
if not survey:
return request.not_found()
raise request.not_found()
answer = request.env["survey.user_input"].sudo().search(
[
@@ -41,14 +41,14 @@ class SurveyExtraFieldsController(Survey):
limit=1,
)
if not answer:
return request.not_found()
raise request.not_found()
line = request.env["survey.user_input.line"].sudo().browse(line_id)
if not line.exists() or line.user_input_id != answer:
return request.not_found()
raise request.not_found()
if not line.value_file:
return request.not_found()
raise request.not_found()
file_content = base64.b64decode(line.value_file)
filename = line.value_file_fname or "file"