Skip to content
Snippets Groups Projects
Commit cab3fdca authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Fixed learning object importer empty verification

parent cfbc82bb
No related branches found
No related tags found
No related merge requests found
...@@ -31,10 +31,6 @@ namespace :import do ...@@ -31,10 +31,6 @@ namespace :import do
# Terminate loop if there are no more items to import # Terminate loop if there are no more items to import
break if dspace_items.empty? break if dspace_items.empty?
dspace_items.select! do |i|
i.parent_collection.id == DspaceService::BD_INT_OBJETOS_COLLECTION
end
next if dspace_items.empty?
# continue if receive an error string # continue if receive an error string
if dspace_items.is_a? String if dspace_items.is_a? String
logger.warn "Received a string instead of items: #{dspace_items}" logger.warn "Received a string instead of items: #{dspace_items}"
...@@ -44,6 +40,10 @@ namespace :import do ...@@ -44,6 +40,10 @@ namespace :import do
# Increment offset, to get new items on next iteration # Increment offset, to get new items on next iteration
offset += limit offset += limit
dspace_items.select! do |i|
i.parent_collection.id == DspaceService::BD_INT_OBJETOS_COLLECTION
end
next if dspace_items.empty?
# Iterates through items # Iterates through items
# Verifies if item is already on repository # Verifies if item is already on repository
# Initializes new LearningObjects # Initializes new LearningObjects
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment