Fix Docx preview marking as ready [SCI-10037] (#7074)

This commit is contained in:
Soufiane 2024-02-12 13:44:02 +01:00 committed by GitHub
parent 81dfe38f07
commit ef16651cf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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,

View file

@ -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