OrderingFilter should call get_serializer_class() to determine default fields. (original) (raw)

Checklist

GenericAPIView says

You'll need to either set these attributes,
or override get_queryset()/get_serializer_class().

But in the method get_valid_fields of the OrderingFilter class, it gets the serializer_class like so

serializer_class = getattr(view, 'serializer_class')

I believe it should be

serializer_class = view.get_serializer_class()

Benjamin