mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-31 02:27:10 -04:00 
			
		
		
		
	Adjusted the sanity checker so that it takes archived documents into account.
This commit is contained in:
		
							parent
							
								
									6388d19f7a
								
							
						
					
					
						commit
						5b020bb8d2
					
				| @ -81,6 +81,17 @@ def check_sanity(): | ||||
|                     f"Stored: {doc.checksum}, actual: {checksum}." | ||||
|                 )) | ||||
| 
 | ||||
|         if os.path.isfile(doc.archive_path): | ||||
|             try: | ||||
|                 with doc.archive_file as f: | ||||
|                     f.read() | ||||
|             except OSError as e: | ||||
|                 messages.append(SanityError( | ||||
|                     f"Cannot read archive file of document {doc.pk}: {e}" | ||||
|                 )) | ||||
| 
 | ||||
|             present_files.remove(os.path.normpath(doc.archive_path)) | ||||
| 
 | ||||
|         if not doc.content: | ||||
|             messages.append(SanityWarning( | ||||
|                 f"Document {doc.pk} has no content." | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user