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"