Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct automatic peer review settings #1554

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/controllers/stash_datacite/publications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def save_form_to_internal_data
@msid = manage_internal_datum(identifier: @se_id, data_type: 'manuscriptNumber', value: parsed_msid)
end

if @resource.identifier.allow_review? && @resource.previous_curated_resource.blank? && @resource.curation_start_date.blank?
# if the newly-set journal wants PPR by default, set the PPR value for this resource
@resource.update(hold_for_peer_review: @se_id.journal&.default_to_ppr)
if @resource.identifier.allow_review? && @resource.previous_curated_resource.blank? &&
@resource.curation_start_date.blank? && @se_id.journal&.default_to_ppr?
# if the newly-set journal wants PPR by default, and it is allowed, set the PPR value for this resource
@resource.update(hold_for_peer_review: @se_id.journal.default_to_ppr)
end

save_doi
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/stash_datacite/resources_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def review
check_required_fields(@resource)
@review = Resource::Review.new(@resource)
@resource.has_geolocation = @review.geolocation_data?
unless @resource.identifier.allow_review? && @resource.previous_curated_resource.blank? && @resource.curation_start_date.blank?
@resource.hold_for_peer_review = false
@resource.peer_review_end_date = nil
end
@resource.save!
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/stash_datacite/peer_review/_review.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if @resource.identifier.allow_review? && @resource.previous_curated_resource.nil? && @resource.curation_start_date.nil? %>
<% if @resource.identifier.allow_review? && @resource.previous_curated_resource.blank? && @resource.curation_start_date.blank? %>
<!-- This is only available if the id has not been curated AND
the associated journal allows a review workflow -->
<div>
Expand Down
Loading