Closed
Description
Proposed Changes
Currently, NetBox initializes django-filter FilterSets passing only the required data and queryset parameters, e.g.
if self.filterset:
self.queryset = self.filterset(request.GET, self.queryset).qs
We can extend this to also pass the current request, which gets saved on the FilterSet instance:
if self.filterset:
self.queryset = self.filterset(request.GET, self.queryset, request=request).qs
This should be applied to all occurrences of FitlerSet instantiation. (This already occurs for API views.)
Justification
Passing the current request to the FilterSet allows filters to reference additional context, such as the user making the request.