Skip to content

Commit

Permalink
Merge pull request #1761 from datadryad/doi-check
Browse files Browse the repository at this point in the history
Stop silently deleting primary DOIs
  • Loading branch information
ryscher authored Jul 15, 2024
2 parents 0cf1cdd + 4a2076c commit 98309f5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/controllers/stash_datacite/publications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ def save_doi

related_dois.each do |rd|
bare_related_doi = Stash::Import::Crossref.bare_doi(doi_string: rd.related_identifier)
return nil if bare_related_doi.include?(bare_form_doi) # user is entering a DOI that we already have
next unless bare_form_doi.include? bare_related_doi
next unless bare_form_doi.include?(bare_related_doi) || bare_related_doi.include?(bare_form_doi) # user is entering a DOI that we already have

standard_doi = RelatedIdentifier.standardize_doi(bare_form_doi)

# user is expanding on a DOI that we already have; update it in the DB (and change the work_type if needed)
rd.update(related_identifier: standard_doi, related_identifier_type: 'doi', work_type: 'primary_article',
hidden: false)
Expand Down

0 comments on commit 98309f5

Please sign in to comment.