From 504aec9f0cbc505493c763f4a4a7136e61f564e7 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Mon, 21 Oct 2019 15:44:54 -0700 Subject: [PATCH] Reassociate code with comment --- rest_framework/filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 80c808deb..a9672da08 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -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()