diff --git a/app/controllers/admin/announcements_controller.rb b/app/controllers/admin/announcements_controller.rb index a5456a4..cea782b 100644 --- a/app/controllers/admin/announcements_controller.rb +++ b/app/controllers/admin/announcements_controller.rb @@ -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 diff --git a/app/helpers/admin/announcements_helper.rb b/app/helpers/admin/announcements_helper.rb index fc3f28e..8c01d52 100644 --- a/app/helpers/admin/announcements_helper.rb +++ b/app/helpers/admin/announcements_helper.rb @@ -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]