Change dependent job failure message entity ref.

Originally we were looking at the underlying project/inventory update
but we are now populating the name of project updates and inventory
updates a lot better so we'll just take their names
This commit is contained in:
Matthew Jones
2015-10-22 10:49:42 -04:00
parent 152ddc4f4f
commit 4603ac5d1c

View File

@@ -170,10 +170,10 @@ def handle_work_error(self, task_id, subtasks=None):
instance_name = ''
if each_task['type'] == 'project_update':
instance = ProjectUpdate.objects.get(id=each_task['id'])
instance_name = instance.project.name
instance_name = instance.name
elif each_task['type'] == 'inventory_update':
instance = InventoryUpdate.objects.get(id=each_task['id'])
instance_name = instance.inventory_source.inventory.name
instance_name = instance.name
elif each_task['type'] == 'job':
instance = Job.objects.get(id=each_task['id'])
instance_name = instance.job_template.name