fix error
This commit is contained in:
parent
7d12d71f14
commit
35d8843705
|
@ -130,8 +130,8 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
if sheet.count <= 503
|
||||
sheet.each_with_index do |row, i|
|
||||
next if i < 3
|
||||
v = row.cells.first.value
|
||||
next if v == "" || v.nil?
|
||||
v = row.cells.first.value rescue nil
|
||||
next if v.blank?
|
||||
import_this_announcement(row, categories, tags)
|
||||
end
|
||||
redirect_to admin_announcements_path
|
||||
|
|
|
@ -33,9 +33,10 @@ module Admin::AnnouncementsHelper
|
|||
value = {}
|
||||
anns = Bulletin.new
|
||||
row.cells.each_with_index do |cell,index|
|
||||
next if cell.nil?
|
||||
val = cell.value
|
||||
next if val.nil? || val == ""
|
||||
val = cell.value rescue nil
|
||||
if [8,9,10,11,12,13,14,15].exclude?(index)
|
||||
next if val.blank?
|
||||
end
|
||||
case index
|
||||
when 0
|
||||
anns.category = categories[val.to_i]
|
||||
|
|
Loading…
Reference in New Issue