From b09d6875c763aed193a2dd71e4ead4d2ed317daa Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 13 Feb 2020 13:43:56 +0100 Subject: [PATCH] don't treat ethz dois different in handle registration. #414 --- app/jobs/url_job.rb | 4 ++-- app/models/doi.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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)