diff --git a/Dockerfile b/Dockerfile index 47d677a69..2fa0a78d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.4.3 +FROM ruby:2.4.4 MAINTAINER BioSistemika # additional dependecies diff --git a/Dockerfile.production b/Dockerfile.production index f4c51a94f..f95743e4b 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -1,4 +1,4 @@ -FROM ruby:2.4.3 +FROM ruby:2.4.4 MAINTAINER BioSistemika # additional dependecies diff --git a/Gemfile b/Gemfile index dfd12a3d4..02f2b5800 100644 --- a/Gemfile +++ b/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' diff --git a/app/models/project.rb b/app/models/project.rb index 16952fb2a..add89f6b7 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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