From ef16651cf38e0801b89a9a717c63ddf8c95acc4f Mon Sep 17 00:00:00 2001 From: Soufiane Date: Mon, 12 Feb 2024 13:44:02 +0100 Subject: [PATCH] Fix Docx preview marking as ready [SCI-10037] (#7074) --- app/datatables/report_datatable.rb | 2 +- app/jobs/reports/docx_job.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/datatables/report_datatable.rb b/app/datatables/report_datatable.rb index 74f061134..59da7c0de 100644 --- a/app/datatables/report_datatable.rb +++ b/app/datatables/report_datatable.rb @@ -76,7 +76,7 @@ class ReportDatatable < CustomDatatable end def docx_file(report) - docx = document_preview_report_path(report, report_type: :docx) if report.docx_file.attached? + docx = document_preview_report_path(report, report_type: :docx) if report.docx_preview_file.attached? { processing: report.docx_processing?, preview_url: docx, diff --git a/app/jobs/reports/docx_job.rb b/app/jobs/reports/docx_job.rb index 6a07768e9..51043ff37 100644 --- a/app/jobs/reports/docx_job.rb +++ b/app/jobs/reports/docx_job.rb @@ -18,7 +18,6 @@ module Reports Reports::Docx.new(report, docx, user: user, scinote_url: root_url).draw docx.save report.docx_file.attach(io: file, filename: 'report.docx') - report.docx_ready! report_path = Rails.application.routes.url_helpers .reports_path(team: report.team.id, preview_report_id: report.id, preview_type: :docx) @@ -37,6 +36,7 @@ module Reports ) Reports::DocxPreviewJob.perform_now(report.id) + report.docx_ready! ensure I18n.backend.date_format = nil file.close