From e20c88dbc71aeedea4027c0c5a1d25c42d086cd2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 17:58:08 +0000 Subject: [PATCH] Address code review feedback: improve variable naming and parameter order Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/tasks/upload_to_email.py | 4 ++-- app/tasks/upload_to_google_drive.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/tasks/upload_to_email.py b/app/tasks/upload_to_email.py index a940aecd..1e47921b 100644 --- a/app/tasks/upload_to_email.py +++ b/app/tasks/upload_to_email.py @@ -161,19 +161,19 @@ def _send_email_with_smtp(msg, filename, recipients): return {"status": "Failed", "reason": error_msg, "error": str(e)} @celery.task(base=BaseTaskWithRetry, bind=True) -def upload_to_email(self, file_path: str, file_id: int = None, recipients=None, subject=None, message=None, template_name="default.html", include_metadata=True): +def upload_to_email(self, file_path: str, recipients=None, subject=None, message=None, template_name="default.html", include_metadata=True, file_id: int = None): """ Sends a file via email to the specified recipients. If recipients is None, uses the configured default email recipient. Args: file_path: Path to the file to send - file_id: Optional file ID to associate with logs recipients: Optional list of recipient email addresses subject: Optional email subject message: Optional custom message template_name: Email template to use include_metadata: Whether to include metadata in the email + file_id: Optional file ID to associate with logs """ task_id = self.request.id logger.info(f"[{task_id}] Starting email send: {file_path}") diff --git a/app/tasks/upload_to_google_drive.py b/app/tasks/upload_to_google_drive.py index 1d539fed..7dd87937 100644 --- a/app/tasks/upload_to_google_drive.py +++ b/app/tasks/upload_to_google_drive.py @@ -240,17 +240,17 @@ def upload_to_google_drive(self, file_path: str, file_id: int = None, include_me ).execute() # Log success details - file_id_gd = file.get('id') + google_drive_file_id = file.get('id') web_view_link = file.get('webViewLink') - logger.info(f"[{task_id}] Successfully uploaded {filename} to Google Drive with ID: {file_id_gd}") + logger.info(f"[{task_id}] Successfully uploaded {filename} to Google Drive with ID: {google_drive_file_id}") logger.info(f"[{task_id}] File accessible at: {web_view_link}") log_task_progress(task_id, "upload_to_google_drive", "success", f"Uploaded to Google Drive: {filename}", file_id=file_id) result = { "status": "Completed", "file_path": file_path, - "google_drive_file_id": file_id_gd, + "google_drive_file_id": google_drive_file_id, "google_drive_web_link": web_view_link }