From 7e91a385f4056c665938834b6e9b3a7296b260e7 Mon Sep 17 00:00:00 2001 From: HaimKortovich Date: Fri, 24 Apr 2026 12:21:53 -0500 Subject: [PATCH] fix indent --- app/routers/documents.py | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/routers/documents.py b/app/routers/documents.py index af916c7..16b2a24 100644 --- a/app/routers/documents.py +++ b/app/routers/documents.py @@ -46,13 +46,13 @@ async def upload_document( s3_key = utils.document_s3_key(org_id, document_id, sanitized_filename) # Prepare metadata - metadata_dict = { + metadata_dict = { "org_id": org_id, "document_type": document_type.value, "filename": sanitized_filename, "file_size": str(file_size), "created_at": datetime.utcnow().isoformat() - } + } # Upload to S3 try: @@ -65,8 +65,8 @@ async def upload_document( # Generate download URL download_url = s3.presigned_download_url(s3_key) - # Create metadata response - metadata = DocumentMetadata( + # Create metadata response + metadata = DocumentMetadata( document_id=document_id, org_id=org_id, document_type=document_type, @@ -76,7 +76,7 @@ async def upload_document( s3_key=s3_key, created_at=datetime.utcnow(), updated_at=datetime.utcnow() - ) + ) logger.info(f"Upload completed - document_id: {document_id}") return UploadResponse(document_id=document_id, metadata=metadata, download_url=download_url) @@ -123,13 +123,13 @@ async def rewrite_document( logger.error(f"Organization mismatch for document: {document_id}") raise HTTPException(status_code=403, detail="Organization mismatch") - # Prepare metadata + # Prepare metadata metadata_dict = { - "org_id": org_id, - "document_type": document_type.value, - "filename": file.filename, - "file_size": str(file_size), - "updated_at": datetime.utcnow().isoformat() + "org_id": org_id, + "document_type": document_type.value, + "filename": sanitized_filename, + "file_size": str(file_size), + "updated_at": datetime.utcnow().isoformat() } # Upload to S3 (overwrites existing) @@ -143,17 +143,17 @@ async def rewrite_document( # Generate download URL download_url = s3.presigned_download_url(s3_key) - # Create metadata response + # Create metadata response metadata = DocumentMetadata( - document_id=document_id, - org_id=org_id, - document_type=document_type, - filename=file.filename, - content_type=detected_content_type, - file_size=file_size, - s3_key=s3_key, - created_at=datetime.fromisoformat(existing_metadata.get("created_at", datetime.utcnow().isoformat())), - updated_at=datetime.utcnow() + document_id=document_id, + org_id=org_id, + document_type=document_type, + filename=sanitized_filename, + content_type=detected_content_type, + file_size=file_size, + s3_key=s3_key, + created_at=datetime.fromisoformat(existing_metadata.get("created_at", datetime.utcnow().isoformat())), + updated_at=datetime.utcnow() ) logger.info(f"Rewrite completed - document_id: {document_id}")