From 44a8da83c2d6cfab805a05b6a0871fb419b1a3a2 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Fri, 22 Apr 2016 12:26:50 -0400 Subject: [PATCH] Removed all encompassing .distinct() call for all views This .distinct() call applied .distinct() to all list query sets. Most query sets are already unique, and adding .distinct causes the database to do a lot of extra work. Views that rely on this behavior will be rooted out during the hardening sprint and .distinct() will be added to the individual querysets as needed instead of applying this everywhere. --- awx/api/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/filters.py b/awx/api/filters.py index 367fd0eda5..abe92861c0 100644 --- a/awx/api/filters.py +++ b/awx/api/filters.py @@ -218,7 +218,7 @@ class FieldLookupBackend(BaseFilterBackend): q = Q(**{k:v}) queryset = queryset.filter(q) queryset = queryset.filter(*args) - return queryset.distinct() + return queryset except (FieldError, FieldDoesNotExist, ValueError), e: raise ParseError(e.args[0]) except ValidationError, e: