OrderingFilter should call get_serializer_class() to determine default fields. · Issue #3957 · encode/django-rest-framework (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@bmampaey

Description

@bmampaey

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