Enable OrderingFilter to handle an empty tuple (or list) for the 'ordering' field. (#5899)

This commit is contained in:
Andrew Tallos 2018-03-26 07:22:45 -04:00 committed by Tom Christie
parent a5072778e9
commit 36119cad31

View File

@ -242,7 +242,7 @@ class OrderingFilter(BaseFilterBackend):
def get_template_context(self, request, queryset, view):
current = self.get_ordering(request, queryset, view)
current = None if current is None else current[0]
current = None if not current else current[0]
options = []
context = {
'request': request,