mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	codestyle
This commit is contained in:
		
							parent
							
								
									751c2ac54b
								
							
						
					
					
						commit
						d92214d412
					
				@ -8,7 +8,8 @@ class AutoLoginMiddleware(MiddlewareMixin):
 | 
			
		||||
 | 
			
		||||
    def process_request(self, request):
 | 
			
		||||
        try:
 | 
			
		||||
            request.user = User.objects.get(username=settings.AUTO_LOGIN_USERNAME)
 | 
			
		||||
            request.user = User.objects.get(
 | 
			
		||||
                username=settings.AUTO_LOGIN_USERNAME)
 | 
			
		||||
        except User.DoesNotExist:
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,8 @@ from django.core.checks import Error, register
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_tesseract_langs():
 | 
			
		||||
    with subprocess.Popen(['tesseract', '--list-langs'], stdout=subprocess.PIPE) as p:
 | 
			
		||||
    with subprocess.Popen(['tesseract', '--list-langs'],
 | 
			
		||||
                          stdout=subprocess.PIPE) as p:
 | 
			
		||||
        stdout, stderr = p.communicate()
 | 
			
		||||
 | 
			
		||||
    return stdout.decode().strip().split("\n")[1:]
 | 
			
		||||
@ -15,7 +16,7 @@ def get_tesseract_langs():
 | 
			
		||||
def check_default_language_available(app_configs, **kwargs):
 | 
			
		||||
    langs = get_tesseract_langs()
 | 
			
		||||
 | 
			
		||||
    if not settings.OCR_LANGUAGE in langs:
 | 
			
		||||
    if settings.OCR_LANGUAGE not in langs:
 | 
			
		||||
        return [Error(
 | 
			
		||||
            f"The default ocr language {settings.OCR_LANGUAGE} is "
 | 
			
		||||
            f"not installed. Paperless cannot OCR your documents "
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user