-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DistanceToPointOrderingFilter from restframework gis produces TypeError #1180
Comments
exception on usage raised over at tfranzel/drf-spectacular#1180
Turns out they broke the interface by forgetting to return the param list from the method. Created a PR upstream: openwisp/django-rest-framework-gis#293 You could also hotfix it with an OpenApiFilterExtension that replaces that broken method in the meantime. Not sure if we want to wrap this with a try/catch because we usually do not hide upstream bugs for obvious reasons. |
Thanks for the PR and the fix suggestion! |
Exception on usage raised over at tfranzel/drf-spectacular#1180 DistanceToPointOrderingFilter.get_schema_operation_parameters was not returning.
Thanks for sending openwisp/django-rest-framework-gis#293, it's merged 👍 |
Describe the bug
When including DistanceToPointOrderingFilter (source code an unhandled TypeError is raised, as you can see in this stack trace:
I don't know if this is a bug or my implementation is faulty.
To Reproduce
REST_FRAMEWORK
settings for filter backends:where shape is a
MultiPolygonField
and DistanceToPointOrderingFilter is imported like this:Expected behavior
If I remove the DistanceToPointOrderingFilter everything works as expected, so I would expect the same behaviour if I add this specific filter backend.
Judging by the line raising the exception, I think
get_schema_operation_parameters
somehow returnsNone
. Maybe, it would be good a idea to handle theTypeError
?Thanks for developing this package!
The text was updated successfully, but these errors were encountered: