mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Merge pull request #2023 from paperless-ngx/fix/2019-create-date
Bugfix: Fix created_date being a string
This commit is contained in:
		
						commit
						a5283525bc
					
				@ -3,6 +3,7 @@ import logging
 | 
			
		||||
import os
 | 
			
		||||
import shutil
 | 
			
		||||
import uuid
 | 
			
		||||
from datetime import datetime
 | 
			
		||||
from pathlib import Path
 | 
			
		||||
from typing import Type
 | 
			
		||||
 | 
			
		||||
@ -98,6 +99,14 @@ def consume_file(
 | 
			
		||||
 | 
			
		||||
    path = Path(path).resolve()
 | 
			
		||||
 | 
			
		||||
    # Celery converts this to a string, but everything expects a datetime
 | 
			
		||||
    # Long term solution is to not use JSON for the serializer but pickle instead
 | 
			
		||||
    if override_created is not None and isinstance(override_created, str):
 | 
			
		||||
        try:
 | 
			
		||||
            override_created = datetime.fromisoformat(override_created)
 | 
			
		||||
        except Exception:
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
    # check for separators in current document
 | 
			
		||||
    if settings.CONSUMER_ENABLE_BARCODES:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user