From 6e24131070924319c0826baacc27c42836b19283 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 7 Oct 2014 16:49:27 -0400 Subject: [PATCH] Change filtering priority to prevent building a queryset with null values when examining project activity stream --- awx/api/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awx/api/views.py b/awx/api/views.py index 1319d23672..ee2c21a9b7 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -621,6 +621,10 @@ class ProjectActivityStreamList(SubListAPIView): parent = self.get_parent_object() self.check_parent_access(parent) qs = self.request.user.get_queryset(self.model) + if parent is None: + return qs + elif parent.credential is None: + return qs.filter(project=parent) return qs.filter(Q(project=parent) | Q(credential__in=parent.credential))