mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +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):
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user