Skip to content

Commit

Permalink
update minted status for dois registered in different handle system
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 25, 2018
1 parent f2823b2 commit 8a6c8bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/jobs/url_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ def perform(doi)

response = Maremma.head(doi.identifier, limit: 0)
if response.headers.present?
doi.update_attributes(url: response.headers["location"])
if doi.is_registered_or_findable && doi.minted.blank?
doi.update_attributes(url: response.headers["location"], minted: Time.zone.now)
else
doi.update_attributes(url: response.headers["location"])
end

logger.debug "Set URL #{response.headers["location"]} for DOI #{doi.doi}"
end
end
Expand Down

0 comments on commit 8a6c8bb

Please sign in to comment.