Skip to content

Commit

Permalink
Avoid changing coversheets_dirty setting for erroring documents
Browse files Browse the repository at this point in the history
  • Loading branch information
drn05r committed Dec 21, 2024
1 parent b195bd6 commit 96356ee
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/update_coversheets_dirty
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ $coversheets->map(sub {
$documents->map(sub{
my( $session, $dataset, $document ) = @_;

if ( $unset_errors && defined $document->get_value( 'coversheet_error') && ( $document->get_value( 'coversheet_error') eq "1" || $document->get_value( 'coversheet_error') eq "TRUE" ) )
if ( $document->get_value( 'coversheet_error' ) && ( $document->get_value( 'coversheet_error' ) eq "1" || $document->get_value( 'coversheet_error' ) eq "TRUE" ) )
{
print "Unsetting coversheet_error for document #".$document->id." for eprint #".$document->get_value( 'eprintid' )."\n" unless $quiet;
$document->set_value( "coversheet_error", undef );
$document->commit;
if ( $unset_errors )
{
print "Unsetting coversheet_error for document #".$document->id." for eprint #".$document->get_value( 'eprintid' )."\n" unless $quiet;
$document->set_value( "coversheet_error", undef );
$document->commit;
}
else
{
return;
}
}
my $eprint = $document->get_eprint;
return if $eprint->get_value( 'coversheets_dirty' ) eq "TRUE";
Expand Down

0 comments on commit 96356ee

Please sign in to comment.