Minor fix for host has_active_failures field, indentation on custom_filters file.

This commit is contained in:
Chris Church
2013-06-10 21:51:34 -04:00
parent 49ca140e30
commit bbdfe8bc46
2 changed files with 8 additions and 9 deletions

View File

@@ -4,8 +4,6 @@
from rest_framework.filters import BaseFilterBackend from rest_framework.filters import BaseFilterBackend
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
# TODO: does order_by still work?
class CustomFilterBackend(object): class CustomFilterBackend(object):
def filter_queryset(self, request, queryset, view): def filter_queryset(self, request, queryset, view):

View File

@@ -204,7 +204,8 @@ class Host(CommonModelNameNotUnique):
@property @property
def has_active_failures(self): def has_active_failures(self):
return self.last_job_host_summary and self.last_job_host_summary.failed return bool(self.last_job_host_summary and
self.last_job_host_summary.failed)
# Use .job_host_summaries.all() to get jobs affecting this host. # Use .job_host_summaries.all() to get jobs affecting this host.
# Use .job_events.all() to get events affecting this host. # Use .job_events.all() to get events affecting this host.