Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions app/models/pdf_generation/project_compile_portfolio_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ def initialize(log_message)

# Create the portfolio for this project
def create_portfolio
self.compile_portfolio = false
save!

logger.info "Creating portfolio for #{user.username} in #{unit.code}"
begin
pac = ProjectAppController.new
pac.init(self, false)
Expand All @@ -142,8 +140,13 @@ def create_portfolio
logger.info "Created portfolio at #{portfolio_path} - #{log_details}"

self.portfolio_production_date = Time.zone.now
save
self.compile_portfolio = false
save!
true
rescue StandardError => e
self.compile_portfolio = false
save!

logger.error "Failed to convert portfolio to PDF - #{log_details} -\nError: #{e.message}"

log_file = e.message.scan(%r{/.*\.log}).first
Expand Down
Loading