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