diff --git a/app/models/research/hal/author.rb b/app/models/research/hal/author.rb index 4db356faaf84186dbf974b2933754b865e78c3c3..d9ab7826da28942c0042f42500540bb324a8aef0 100644 --- a/app/models/research/hal/author.rb +++ b/app/models/research/hal/author.rb @@ -65,7 +65,8 @@ class Research::Hal::Author < ApplicationRecord end def import_research_hal_publications! - publications.hal.clear + # HAL author has only HAL publications + publications.clear # Do not overuse the API if no researcher is concerned return if researchers.none? Importers::Hal.import_publications_for_author(self).each do |publication| diff --git a/app/models/university/person/with_research.rb b/app/models/university/person/with_research.rb index da728421fbd7de53f12f2a1a47ff7d044eb839c3..d70abcb3ffe0ae0b895a76e95569d37200ccee2c 100644 --- a/app/models/university/person/with_research.rb +++ b/app/models/university/person/with_research.rb @@ -34,7 +34,7 @@ module University::Person::WithResearch end def import_research_hal_publications! - publications.hal.clear + publications.delete(publications.hal) hal_authors.each do |author| # TODO manage same researcher in different universities publications.concat author.import_research_hal_publications!