diff --git a/app/jobs/crossref_doi_by_id_job.rb b/app/jobs/crossref_doi_by_id_job.rb index 122e94c23..40dc74e3c 100644 --- a/app/jobs/crossref_doi_by_id_job.rb +++ b/app/jobs/crossref_doi_by_id_job.rb @@ -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 diff --git a/app/models/event.rb b/app/models/event.rb index 02e2f09f5..7666df154 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -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