mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Reassociate code with comment
This commit is contained in:
parent
20c1acf4c4
commit
504aec9f0c
|
@ -204,11 +204,11 @@ class OrderingFilter(BaseFilterBackend):
|
|||
return ordering
|
||||
|
||||
def get_default_valid_fields(self, queryset, view, context=None):
|
||||
# If `ordering_fields` is not specified, then we determine a default
|
||||
# based on the serializer class, if one exists on the view.
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
# If `ordering_fields` is not specified, then we determine a default
|
||||
# based on the serializer class, if one exists on the view.
|
||||
if hasattr(view, 'get_serializer_class'):
|
||||
try:
|
||||
serializer_class = view.get_serializer_class()
|
||||
|
|
Loading…
Reference in New Issue
Block a user