From f4c1c817c2415c21fb5aeceb7fc1b531d3f1db73 Mon Sep 17 00:00:00 2001 From: "T. Franzel" Date: Thu, 22 Feb 2024 15:59:18 +0100 Subject: [PATCH] [fix] Fixed missing return statement in DistanceToPointOrderingFilter Exception on usage raised over at https://github.com/tfranzel/drf-spectacular/issues/1180 DistanceToPointOrderingFilter.get_schema_operation_parameters was not returning. --- rest_framework_gis/filters.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rest_framework_gis/filters.py b/rest_framework_gis/filters.py index 07d264f8..5c175837 100644 --- a/rest_framework_gis/filters.py +++ b/rest_framework_gis/filters.py @@ -292,8 +292,8 @@ def filter_queryset(self, request, queryset, view): return queryset.order_by(GeometryDistance(filter_field, point)) def get_schema_operation_parameters(self, view): - params = super().get_schema_operation_parameters(view) - params.append( + return [ + *super().get_schema_operation_parameters(view), { "name": self.order_param, "required": False, @@ -306,5 +306,5 @@ def get_schema_operation_parameters(self, view): }, "style": "form", "explode": False, - } - ) + }, + ]