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.
This commit is contained in:
Akita Noek 2016-04-22 12:26:50 -04:00
parent 8f9fe93de5
commit 44a8da83c2

View File

@ -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: