mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Don't run document checks if table doesn't exist yet
This commit is contained in:
		
							parent
							
								
									2ab2c37f5a
								
							
						
					
					
						commit
						52b0249d71
					
				@ -1,4 +1,5 @@
 | 
				
			|||||||
from django.core.checks import Warning, register
 | 
					from django.core.checks import Warning, register
 | 
				
			||||||
 | 
					from django.db.utils import OperationalError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@register()
 | 
					@register()
 | 
				
			||||||
@ -17,10 +18,12 @@ def changed_password_check(app_configs, **kwargs):
 | 
				
			|||||||
        "re-import them."
 | 
					        "re-import them."
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    document = Document.objects.order_by("-pk").filter(
 | 
					    try:
 | 
				
			||||||
        storage_type=Document.STORAGE_TYPE_GPG
 | 
					        document = Document.objects.order_by("-pk").filter(
 | 
				
			||||||
    ).first()
 | 
					            storage_type=Document.STORAGE_TYPE_GPG).first()
 | 
				
			||||||
 | 
					        if document and not GnuPG.decrypted(document.source_file):
 | 
				
			||||||
 | 
					            return [Warning(warning.format(document))]
 | 
				
			||||||
 | 
					    except OperationalError:
 | 
				
			||||||
 | 
					        pass  # No documents table yet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if document and not GnuPG.decrypted(document.source_file):
 | 
					 | 
				
			||||||
        return [Warning(warning.format(document))]
 | 
					 | 
				
			||||||
    return []
 | 
					    return []
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user