From 984700caf4b345358088621482b1e443a6e26c53 Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Wed, 31 Jul 2024 10:17:58 +0200
Subject: [PATCH] replace string concatenation with f-string interpolation

---
 gso/workflows/tasks/send_email_notifications.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gso/workflows/tasks/send_email_notifications.py b/gso/workflows/tasks/send_email_notifications.py
index f54a4b47..e30916cc 100644
--- a/gso/workflows/tasks/send_email_notifications.py
+++ b/gso/workflows/tasks/send_email_notifications.py
@@ -23,14 +23,16 @@ def send_email_notifications(state: State) -> None:
     for failure in state["failed_tasks"]:
         failed_task_url = f"{base_url}/workflows/{failure["process_id"]}"
         failed_subscription = get_subscription_by_process_id(failure["process_id"])
-        all_alerts += "------\n\n"
+        all_alerts = f"{all_alerts}------\n\n"
         if failed_subscription:
-            all_alerts += (
-                f"Product name: {failed_subscription.product.name}\nDescription: {failed_subscription.description}\n"
+            all_alerts = (
+                f"{all_alerts}Product name: {failed_subscription.product.name}\n"
+                f"Description: {failed_subscription.description}\n"
             )
-        all_alerts += (
-            f'The step "{failure["last_step"]}" failed for the following reason: "{failure["failed_reason"]}".\n\n'
-            f'Please inspect the full workflow at the following link: {failed_task_url}.\n\n'
+        all_alerts = (
+            f'{all_alerts}The step "{failure["last_step"]}" failed for the following reason: '
+            f'"{failure["failed_reason"]}".\n\nPlease inspect the full workflow at the following link: '
+            f'{failed_task_url}.\n\n'
         )
 
     send_mail(
-- 
GitLab