Merge pull request #1357 from okriuchykhin/ok_SCI_2834

Fix permission helpers in delayed export job [SCI-2834]
This commit is contained in:
Alex Kriuchykhin 2018-11-07 10:56:10 +01:00 committed by GitHub
commit 74d99973a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View file

@ -1,4 +1,4 @@
FROM ruby:2.4.3
FROM ruby:2.4.4
MAINTAINER BioSistemika <info@biosistemika.com>
# additional dependecies

View file

@ -1,4 +1,4 @@
FROM ruby:2.4.3
FROM ruby:2.4.4
MAINTAINER BioSistemika <info@biosistemika.com>
# additional dependecies

View file

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

View file

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