Reassociate code with comment

This commit is contained in:
Ryan P Kilby 2019-10-21 15:44:54 -07:00 committed by GitHub
parent 20c1acf4c4
commit 504aec9f0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()