diff --git a/backend/app/api/api_v1/endpoints/reports.py b/backend/app/api/api_v1/endpoints/reports.py index 70f5cf5..419c6c1 100644 --- a/backend/app/api/api_v1/endpoints/reports.py +++ b/backend/app/api/api_v1/endpoints/reports.py @@ -66,9 +66,7 @@ def _validate_upload_file(file: UploadFile, file_content: bytes) -> None: """ # Security: Validate filename is provided if not file.filename: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, detail="Filename is required" - ) + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Filename is required") # Security: Validate file extension file_ext = "." + file.filename.rsplit(".", 1)[-1].lower() if "." in file.filename else "" @@ -97,13 +95,9 @@ def _handle_upload_value_error(filename: str, error_message: str) -> None: status_code=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE, detail="File too large" ) elif "zip bomb" in error_message.lower(): - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid archive file" - ) + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid archive file") else: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid report format" - ) + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid report format") class UploadResponse(BaseModel): diff --git a/backend/app/services/dmarc_parser.py b/backend/app/services/dmarc_parser.py index 73ba7b9..c5944f2 100644 --- a/backend/app/services/dmarc_parser.py +++ b/backend/app/services/dmarc_parser.py @@ -237,9 +237,7 @@ class DMARCParser: # Log parse results for debugging total_count = report["summary"]["total_count"] logger.info(f"Parsed DMARC report for domain: {report.get('domain')}") - logger.info( - f"Found {len(records)} record entries with {total_count} total messages" - ) + logger.info(f"Found {len(records)} record entries with {total_count} total messages") logger.info( f"Messages passed: {report['summary']['passed_count']}, " f"failed: {report['summary']['failed_count']}"