fix channel upload error
This commit is contained in:
parent
5f44500dfb
commit
4ff5f6f35b
@ -577,12 +577,12 @@ class ChannelsController < ApplicationController
|
|||||||
headers = false
|
headers = false
|
||||||
|
|
||||||
# if there are at least 2 rows
|
# if there are at least 2 rows
|
||||||
if (csv_array[0] and csv_array[1])
|
if (csv_array[0].present? && csv_array[1].present?)
|
||||||
row0_integers = 0
|
row0_integers = 0
|
||||||
row1_integers = 0
|
row1_integers = 0
|
||||||
|
|
||||||
# if first row, first value contains 'create' or 'date', assume it has headers
|
# if first row, first value contains 'create' or 'date', assume it has headers
|
||||||
if (csv_array[0][0].downcase.include?('create') or csv_array[0][0].downcase.include?('date'))
|
if (csv_array[0][0].present? && (csv_array[0][0].downcase.include?('create') || csv_array[0][0].downcase.include?('date')))
|
||||||
headers = true
|
headers = true
|
||||||
else
|
else
|
||||||
# count integers in row0
|
# count integers in row0
|
||||||
|
Loading…
Reference in New Issue
Block a user