Fix projects exports with tables [SCI-8827] (#5840)

This commit is contained in:
Alex Kriuchykhin 2023-07-21 16:44:03 +02:00 committed by GitHub
parent f735c917af
commit 9d336423ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -276,7 +276,7 @@ class Project < ApplicationRecord
tables = parsed_html.css('.hot-table-contents')
.zip(parsed_html.css('.hot-table-container'), parsed_html.css('.hot-table-metadata'))
tables.each do |table_input, table_container, metadata|
is_plate_template = JSON.parse(metadata['value'])['plateTemplate'] if metadata.present?
is_plate_template = JSON.parse(metadata['value'])['plateTemplate'] if metadata && metadata['value'].present?
table_vals = JSON.parse(table_input['value'])
table_data = table_vals['data']
table_headers = table_vals['headers']

View file

@ -122,7 +122,7 @@ class Report < ApplicationRecord
)
end
report = Report.new
report = Report.new(skip_user_assignments: true)
report.name = loop do
dummy_name = SecureRandom.hex(10)
break dummy_name unless Report.exists?(name: dummy_name)