diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index 95034cb12..43ac9eb1f 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -18,6 +18,7 @@ * [#8924](https://github.com/netbox-community/netbox/issues/8924) - Improve load time of custom script list * [#8932](https://github.com/netbox-community/netbox/issues/8932) - Fix error when setting null value for interface `rf_role` via REST API * [#8935](https://github.com/netbox-community/netbox/issues/8935) - Correct ordering of next/previous racks to use naturalized names +* [#8947](https://github.com/netbox-community/netbox/issues/8947) - Retain filter parameters when handling an export template exception * [#8951](https://github.com/netbox-community/netbox/issues/8951) - Allow changing device type & platform to different manufacturer simultaneously --- diff --git a/netbox/netbox/views/generic.py b/netbox/netbox/views/generic.py index 74f8f325b..46bc5b24e 100644 --- a/netbox/netbox/views/generic.py +++ b/netbox/netbox/views/generic.py @@ -212,7 +212,10 @@ class ObjectListView(ObjectPermissionRequiredMixin, View): return template.render_to_response(self.queryset) except Exception as e: messages.error(request, f"There was an error rendering the selected export template ({template.name}): {e}") - return redirect(request.path) + # Strip the `export` param and redirect user to the filtered objects list + query_params = request.GET.copy() + query_params.pop('export') + return redirect(f'{request.path}?{query_params.urlencode()}') def get(self, request): model = self.queryset.model