From 3ff0c42f9f47ae1153f423d761448742662d539f Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 10 Feb 2019 13:59:34 +0100 Subject: [PATCH] update state differently. #202 --- app/jobs/url_job.rb | 6 +++--- config/initializers/_version.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/jobs/url_job.rb b/app/jobs/url_job.rb index 1d2a18a0e..cf1a7de1a 100644 --- a/app/jobs/url_job.rb +++ b/app/jobs/url_job.rb @@ -14,14 +14,14 @@ def perform(doi_id) response = Doi.get_doi(doi: doi.doi) url = response.body.dig('data', 'values', 0, 'data', 'value') if url.present? - if doi.is_registered_or_findable? && doi.minted.blank? + if %w(europ ethz).include?(doi.provider_id) && doi.minted.blank? + doi.update_attributes(url: url, minted: Time.zone.now, aasm_state: "findable") + elsif doi.is_registered_or_findable? && doi.minted.blank? doi.update_attributes(url: url, minted: Time.zone.now) else doi.update_attributes(url: url) end - doi.event = "publish" if %w(europ ethz).include?(doi.provider_id) - doi.__elasticsearch__.index_document logger.info "[Handle] URL #{url} set for DOI #{doi.doi}." diff --git a/config/initializers/_version.rb b/config/initializers/_version.rb index c67e3e137..0b69e9a50 100644 --- a/config/initializers/_version.rb +++ b/config/initializers/_version.rb @@ -1,5 +1,5 @@ module Lupo class Application - VERSION = "2.3.26" + VERSION = "2.3.27" end end \ No newline at end of file