mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
Enable OrderingFilter to handle an empty tuple (or list) for the 'ordering' field. (#5899)
This commit is contained in:
parent
a5072778e9
commit
36119cad31
|
@ -242,7 +242,7 @@ class OrderingFilter(BaseFilterBackend):
|
||||||
|
|
||||||
def get_template_context(self, request, queryset, view):
|
def get_template_context(self, request, queryset, view):
|
||||||
current = self.get_ordering(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 = []
|
options = []
|
||||||
context = {
|
context = {
|
||||||
'request': request,
|
'request': request,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user