diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index ed326f5d4f..60663a8087 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -705,6 +705,8 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana JobNotificationMixin ''' def get_notification_templates(self): + if not self.job_template: + return NotificationTemplate.objects.none() return self.job_template.notification_templates def get_notification_friendly_name(self): diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 131e1179a7..c89a885355 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -350,7 +350,7 @@ def handle_work_error(self, task_id, subtasks=None): try: instance = UnifiedJob.get_instance_by_type(each_task['type'], each_task['id']) except ObjectDoesNotExist: - logger.warning('Missing {} `{}` in success callback.'.format(each_task['type'], task_actual['id'])) + logger.warning('Missing {} `{}` in success callback.'.format(each_task['type'], each_task['id'])) instance = None if not instance: # Unknown task type