mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #8947: Retain filter parameters when handling an export template exception
This commit is contained in:
parent
30a6dc2f64
commit
c78e7c14d3
@ -18,6 +18,7 @@
|
|||||||
* [#8924](https://github.com/netbox-community/netbox/issues/8924) - Improve load time of custom script list
|
* [#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
|
* [#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
|
* [#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
|
* [#8951](https://github.com/netbox-community/netbox/issues/8951) - Allow changing device type & platform to different manufacturer simultaneously
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -212,7 +212,10 @@ class ObjectListView(ObjectPermissionRequiredMixin, View):
|
|||||||
return template.render_to_response(self.queryset)
|
return template.render_to_response(self.queryset)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
messages.error(request, f"There was an error rendering the selected export template ({template.name}): {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):
|
def get(self, request):
|
||||||
model = self.queryset.model
|
model = self.queryset.model
|
||||||
|
Loading…
Reference in New Issue
Block a user