mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-14 09:04:56 +08:00
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:
commit
62cf439734
2 changed files with 9 additions and 7 deletions
|
@ -17,11 +17,13 @@ module ImportRepository
|
||||||
private
|
private
|
||||||
|
|
||||||
def run_import_actions
|
def run_import_actions
|
||||||
@repository.import_records(
|
@temp_file.file.open do |temp_file|
|
||||||
SpreadsheetParser.open_spreadsheet(@temp_file.file),
|
@repository.import_records(
|
||||||
@mappings,
|
SpreadsheetParser.open_spreadsheet(temp_file),
|
||||||
@user
|
@mappings,
|
||||||
)
|
@user
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_checks
|
def run_checks
|
||||||
|
|
|
@ -7,8 +7,8 @@ class SpreadsheetParser
|
||||||
filename = file.original_filename
|
filename = file.original_filename
|
||||||
file_path = file.path
|
file_path = file.path
|
||||||
else
|
else
|
||||||
filename = file.filename.to_s
|
filename = File.basename(file.path)
|
||||||
file_path = file.service_url
|
file_path = file.path
|
||||||
end
|
end
|
||||||
|
|
||||||
case File.extname(filename)
|
case File.extname(filename)
|
||||||
|
|
Loading…
Add table
Reference in a new issue