Merge pull request #2163 from biosistemika/SCI-3994-excel-import-to-inventory-fails-v2

SCI-3994 fix for excel import
This commit is contained in:
Alex Kriuchykhin 2019-10-17 16:53:32 +02:00 committed by GitHub
commit 62cf439734
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -17,11 +17,13 @@ module ImportRepository
private
def run_import_actions
@repository.import_records(
SpreadsheetParser.open_spreadsheet(@temp_file.file),
@mappings,
@user
)
@temp_file.file.open do |temp_file|
@repository.import_records(
SpreadsheetParser.open_spreadsheet(temp_file),
@mappings,
@user
)
end
end
def run_checks

View file

@ -7,8 +7,8 @@ class SpreadsheetParser
filename = file.original_filename
file_path = file.path
else
filename = file.filename.to_s
file_path = file.service_url
filename = File.basename(file.path)
file_path = file.path
end
case File.extname(filename)