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