Skip to content

Commit

Permalink
don't treat ethz dois different in handle registration. #414
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 13, 2020
1 parent a173d64 commit b09d687
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/jobs/url_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b09d687

Please sign in to comment.