mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Bulk badge awards should work even if the CSV has nil values
This commit is contained in:
@@ -55,8 +55,12 @@ class Admin::BadgesController < Admin::AdminController
|
||||
csv.rewind
|
||||
|
||||
csv.each_line do |email_line|
|
||||
batch.concat CSV.parse_line(email_line)
|
||||
line_number += 1
|
||||
line = CSV.parse_line(email_line).first
|
||||
|
||||
if line.present?
|
||||
batch << line
|
||||
line_number += 1
|
||||
end
|
||||
|
||||
# Split the emails in batches of 200 elements.
|
||||
full_batch = csv.lineno % (BadgeGranter::MAX_ITEMS_FOR_DELTA * batch_number) == 0
|
||||
|
Reference in New Issue
Block a user