From 2fee977b4c141b39e5b58e6ade9fb676f1d12d46 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 5 Oct 2018 10:30:13 -0400 Subject: [PATCH] Fixes #2485: Fix cancel button when assigning a service to a device/VM --- CHANGELOG.md | 1 + netbox/ipam/views.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db5c2308..d637f88c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ v2.4.6 (FUTURE) * [#2483](https://github.com/digitalocean/netbox/issues/2483) - Set max item count of API-populated form fields to MAX_PAGE_SIZE * [#2484](https://github.com/digitalocean/netbox/issues/2484) - Local config context not available on the Virtual Machine Edit Form +* [#2485](https://github.com/digitalocean/netbox/issues/2485) - Fix cancel button when assigning a service to a device/VM --- diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 91c741789..2e3e0105c 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -991,6 +991,9 @@ class ServiceCreateView(PermissionRequiredMixin, ObjectEditView): obj.virtual_machine = get_object_or_404(VirtualMachine, pk=url_kwargs['virtualmachine']) return obj + def get_return_url(self, request, service): + return service.parent.get_absolute_url() + class ServiceEditView(ServiceCreateView): permission_required = 'ipam.change_service'