mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Fix Docx preview marking as ready [SCI-10037] (#7074)
This commit is contained in:
parent
81dfe38f07
commit
ef16651cf3
2 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue