From 9b67b575f126c071b052698d31325185dc2adee4 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 3 Feb 2014 06:11:51 -0500 Subject: [PATCH] Fix issue AC-1002, make sure we return a count of the number of inventories with active failed jobs --- awx/api/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index f2aa3530b7..5b2d88b4cb 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -139,12 +139,13 @@ class DashboardView(APIView): data = SortedDict() user_inventory = get_user_queryset(request.user, Inventory) + inventory_with_failed_hosts = user_inventory.filter(hosts_with_active_failures__gt=0) user_inventory_external = user_inventory.filter(has_inventory_sources=True) failed_inventory = sum(i.inventory_sources_with_failures for i in user_inventory) data['inventories'] = {'url': reverse('api:inventory_list'), 'total': user_inventory.count(), 'total_with_inventory_source': user_inventory_external.count(), - #'job_failed' + 'job_failed': inventory_with_failed_hosts.count(), 'inventory_failed': failed_inventory} user_inventory_sources = get_user_queryset(request.user, InventorySource) rax_inventory_sources = user_inventory_sources.filter(source='rax')