mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Better Handle arbitrary ISO 8601 strings with dateutil.parser.isoparse
This commit is contained in:
		@@ -3,10 +3,10 @@ import logging
 | 
				
			|||||||
import os
 | 
					import os
 | 
				
			||||||
import shutil
 | 
					import shutil
 | 
				
			||||||
import uuid
 | 
					import uuid
 | 
				
			||||||
from datetime import datetime
 | 
					 | 
				
			||||||
from pathlib import Path
 | 
					from pathlib import Path
 | 
				
			||||||
from typing import Type
 | 
					from typing import Type
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import dateutil.parser
 | 
				
			||||||
import tqdm
 | 
					import tqdm
 | 
				
			||||||
from asgiref.sync import async_to_sync
 | 
					from asgiref.sync import async_to_sync
 | 
				
			||||||
from celery import shared_task
 | 
					from celery import shared_task
 | 
				
			||||||
@@ -105,7 +105,7 @@ def consume_file(
 | 
				
			|||||||
    # More types will be retained through JSON encode/decode
 | 
					    # More types will be retained through JSON encode/decode
 | 
				
			||||||
    if override_created is not None and isinstance(override_created, str):
 | 
					    if override_created is not None and isinstance(override_created, str):
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            override_created = datetime.fromisoformat(override_created)
 | 
					            override_created = dateutil.parser.isoparse(override_created)
 | 
				
			||||||
        except Exception:
 | 
					        except Exception:
 | 
				
			||||||
            pass
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user