mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 09:30:07 +03:00
Reassociate code with comment
This commit is contained in:
parent
20c1acf4c4
commit
504aec9f0c
|
@ -204,11 +204,11 @@ class OrderingFilter(BaseFilterBackend):
|
||||||
return ordering
|
return ordering
|
||||||
|
|
||||||
def get_default_valid_fields(self, queryset, view, context=None):
|
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:
|
if context is None:
|
||||||
context = {}
|
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'):
|
if hasattr(view, 'get_serializer_class'):
|
||||||
try:
|
try:
|
||||||
serializer_class = view.get_serializer_class()
|
serializer_class = view.get_serializer_class()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user