diff --git a/app/jobs/url_job.rb b/app/jobs/url_job.rb index 2226b1125..3a09cca9d 100644 --- a/app/jobs/url_job.rb +++ b/app/jobs/url_job.rb @@ -13,13 +13,13 @@ def perform(doi_id) response = Doi.get_doi(doi: doi.doi, agency: doi.agency) url = response.body.dig('data', 'values', 0, 'data', 'value') if url.present? - if (doi.is_registered_or_findable? || %w(ethz europ crossref medra kisti jalc op).include?(doi.provider_id)) && doi.minted.blank? + if (doi.is_registered_or_findable? || %w(europ crossref medra kisti jalc op).include?(doi.provider_id)) && doi.minted.blank? doi.update_attributes(url: url, minted: Time.zone.now) else doi.update_attributes(url: url) end - doi.update_attributes(aasm_state: "findable") if %w(ethz europ crossref medra kisti jalc op).include?(doi.provider_id) + doi.update_attributes(aasm_state: "findable") if %w(europ crossref medra kisti jalc op).include?(doi.provider_id) doi.__elasticsearch__.index_document diff --git a/app/models/doi.rb b/app/models/doi.rb index aed0f97da..e0cfdac70 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -1255,7 +1255,7 @@ def validatable? def update_url return nil if current_user.nil? || !is_registered_or_findable? - if %w(ethz europ crossref medra kisti jalc op).include?(provider_id) + if %w(europ crossref medra kisti jalc op).include?(provider_id) UrlJob.perform_later(doi) else HandleJob.perform_later(doi)