mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
Set scinote template if missing when generating reports [SCI-5819]
This commit is contained in:
parent
b7513c6d5f
commit
2427086372
1 changed files with 11 additions and 0 deletions
|
@ -207,6 +207,8 @@ class ReportsController < ApplicationController
|
|||
format.json do
|
||||
@report.docx_processing!
|
||||
log_activity(:generate_docx_report)
|
||||
|
||||
ensure_report_template!
|
||||
Reports::DocxJob.perform_later(@report.id, current_user, root_url)
|
||||
render json: {
|
||||
message: I18n.t('projects.reports.index.generation.accepted_message')
|
||||
|
@ -564,6 +566,15 @@ class ReportsController < ApplicationController
|
|||
|
||||
@report.pdf_processing!
|
||||
log_activity(:generate_pdf_report)
|
||||
|
||||
ensure_report_template!
|
||||
Reports::PdfJob.perform_later(@report.id, current_user)
|
||||
end
|
||||
|
||||
def ensure_report_template!
|
||||
return if @report.settings['template'].present?
|
||||
|
||||
@report.settings['template'] = 'scinote_template'
|
||||
@report.save
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue