From 0e2fb021856d9a65d31d06cdf516a67bb87cf68e Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 8 Feb 2021 17:38:58 -0500 Subject: [PATCH] Fix test notifications --- awx/main/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 38f9930bd1..32529c3d21 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -336,7 +336,8 @@ def send_notifications(notification_list, job_id=None): sent = notification.notification_template.send(notification.subject, notification.body) notification.status = "successful" notification.notifications_sent = sent - job_actual.log_lifecycle("notifications_sent") + if job_id is not None: + job_actual.log_lifecycle("notifications_sent") except Exception as e: logger.exception("Send Notification Failed {}".format(e)) notification.status = "failed"