Skip to content

Commit

Permalink
remove obsolete method
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jun 23, 2019
1 parent 40fe0b6 commit b7f7ca8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion app/jobs/crossref_doi_by_id_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def perform(id)
if [200, 201].include?(response.status)
logger.info "DOI #{doi} created."
else
logger.warn response.body["errors"]
logger.warn "[Error for DOI #{doi}]: " + response.body["errors"]
end
end

Expand Down
21 changes: 0 additions & 21 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,27 +331,6 @@ def self.update_datacite_crossref(options={})
response.results.total
end

def self.get_crossref_metadata(id)
logger = Logger.new(STDOUT)

doi = doi_from_url(id)
return {} unless doi.present?

# check whether DOI has been registered with DataCite already
result = Doi.find_by_id(doi).results.first
if result.blank?
# otherwise store Crossref metadata with DataCite
# using client crossref.citations and DataCite XML
xml = Base64.strict_encode64(id)
d = Doi.new({ xml: xml, source: "levriero", event: "publish", client_id: "crossref.citations" }, :without_protection => true)
if d.save
logger.info "Record for DOI #{doi} created."
else
logger.warn "[Error for #{doi}]: " + d.errors.inspect
end
end
end

def to_param # overridden, use uuid instead of id
uuid
end
Expand Down

0 comments on commit b7f7ca8

Please sign in to comment.