Skip to content
Snippets Groups Projects
Verified Commit 984700ca authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

replace string concatenation with f-string interpolation

parent c8e4965d
No related branches found
No related tags found
1 merge request!239Feature/send validation emails
Pipeline #88157 passed
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment