mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 18:52:07 +08:00
Merge pull request #1357 from okriuchykhin/ok_SCI_2834
Fix permission helpers in delayed export job [SCI-2834]
This commit is contained in:
commit
74d99973a5
4 changed files with 6 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM ruby:2.4.3
|
||||
FROM ruby:2.4.4
|
||||
MAINTAINER BioSistemika <info@biosistemika.com>
|
||||
|
||||
# additional dependecies
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM ruby:2.4.3
|
||||
FROM ruby:2.4.4
|
||||
MAINTAINER BioSistemika <info@biosistemika.com>
|
||||
|
||||
# additional dependecies
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,6 +1,6 @@
|
|||
source 'http://rubygems.org'
|
||||
|
||||
ruby '2.4.3'
|
||||
ruby '2.4.4'
|
||||
|
||||
gem 'rails', '5.1.6'
|
||||
gem 'webpacker', '~> 2.0'
|
||||
|
|
|
@ -225,6 +225,7 @@ class Project < ApplicationRecord
|
|||
def generate_report_pdf(user, team, pdf_name, obj_filenames = nil)
|
||||
ActionController::Renderer::RACK_KEY_TRANSLATION['warden'] ||= 'warden'
|
||||
proxy = Warden::Proxy.new({}, Warden::Manager.new({}))
|
||||
proxy.set_user(user, scope: :user, store: false)
|
||||
renderer = ApplicationController.renderer.new(warden: proxy)
|
||||
|
||||
report = Report.generate_whole_project_report(self, user, team)
|
||||
|
@ -236,7 +237,6 @@ class Project < ApplicationRecord
|
|||
assigns: { project: self, report: report }
|
||||
parsed_page_html = Nokogiri::HTML(page_html_string)
|
||||
parsed_pdf_html = parsed_page_html.at_css('#report-content')
|
||||
report.destroy
|
||||
|
||||
tables = parsed_pdf_html.css('.hot-table-contents')
|
||||
.zip(parsed_pdf_html.css('.hot-table-container'))
|
||||
|
@ -285,5 +285,7 @@ class Project < ApplicationRecord
|
|||
current_team: team,
|
||||
extra: '--keep-relative-links'
|
||||
)
|
||||
ensure
|
||||
report.destroy if report.present?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue