Skip to content

Commit

Permalink
only update landing page info if there is content
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 26, 2018
1 parent c4ac60c commit bcaa93f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -551,14 +551,11 @@ def safe_params
end
p.merge!(version_info: p[:version] || meta["version_info"]) if p.has_key?(:version_info) || meta["version_info"].present?

# only update landing_page info if something is received via API to not overwrite existing data
p.merge!(landing_page: p[:landingPage]) if p[:landingPage].present?

p.merge(
regenerate: p[:regenerate] || regenerate,
landing_page: p[:landingPage],
last_landing_page: p[:lastLandingPage],
last_landing_page_status: p[:lastLandingPageStatus],
last_landing_page_status_check: p[:lastLandingPageStatusCheck],
last_landing_page_status_result: p[:lastLandingPageStatusResult],
last_landing_page_content_type: p[:lastLandingPageContentType]
regenerate: p[:regenerate] || regenerate
).except(
:confirmDoi, :prefix, :suffix, :publicationYear,
:rightsList, :relatedIdentifiers, :fundingReferences, :geoLocations,
Expand Down

0 comments on commit bcaa93f

Please sign in to comment.