Skip to content

Commit

Permalink
update state differently. #202
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 10, 2019
1 parent 147de6c commit 3ff0c42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/jobs/url_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/_version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Lupo
class Application
VERSION = "2.3.26"
VERSION = "2.3.27"
end
end

0 comments on commit 3ff0c42

Please sign in to comment.