@@ -282,6 +282,7 @@ def automated_validation
282
282
def check_pdf_files
283
283
has_acc = false
284
284
inames = Hash [ names . map { |n | [ n , false ] } ]
285
+ anames = Hash [ names . map { |n | [ n , false ] } ]
285
286
[ publication_pdf , supplementary_pdf ] . each do |as |
286
287
break if has_acc && inames . values . all?
287
288
next unless as . attached?
@@ -295,19 +296,20 @@ def check_pdf_files
295
296
bn = n . base_name
296
297
cn = n . corrigendum_from
297
298
inames [ n ] = true if txt . index ( bn ) || ( cn && txt . index ( cn ) )
299
+ anames [ n ] = true if txt . index ( n . seqcode_url ( false ) )
298
300
end
299
- break if has_acc && inames . values . all?
301
+ break if ( has_acc || anames . values . all? ) && inames . values . all?
300
302
end
301
303
end
302
304
end
303
305
304
306
names . each do |n |
305
- Check . create_with ( pass : has_acc ) . find_or_create_by (
307
+ v = has_acc || anames [ n ]
308
+ Check . create_with ( pass : v ) . find_or_create_by (
306
309
name : n , kind : :effective_publication_missing_accession
307
- ) . update ( pass : has_acc )
308
- end
310
+ ) . update ( pass : v )
309
311
310
- inames . each do | n , v |
312
+ v = inames [ n ]
311
313
Check . create_with ( pass : v ) . find_or_create_by (
312
314
name : n , kind : :name_missing_in_effective_publication
313
315
) . update ( pass : v )
@@ -316,5 +318,8 @@ def check_pdf_files
316
318
add_note ( 'The effective publication files have been parsed' )
317
319
318
320
has_acc && inames . values . all?
321
+ rescue => e
322
+ add_note ( 'ERROR: The effective publication files could not be parsed' )
323
+ raise e
319
324
end
320
325
end
0 commit comments