Skip to content

Commit

Permalink
handle missing required values
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jun 10, 2020
1 parent e1a08ed commit 1ed56cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/graphql/types/doi_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ module DoiItem
end

def type
object.types["resourceTypeGeneral"]
object.types["resourceTypeGeneral"] || "Work"
end

def creators(**args)
Expand Down
4 changes: 2 additions & 2 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1905,9 +1905,9 @@ def set_defaults
end

def update_agency
if agency.casecmp?("datacite") || agency.blank?
if agency.to_s.casecmp?("datacite") || agency.blank?
self.agency = "datacite"
elsif agency.casecmp? ("crossref")
elsif agency.to_s.casecmp? ("crossref")
self.agency = "crossref"
end
end
Expand Down

0 comments on commit 1ed56cc

Please sign in to comment.