From 2e75a111ed0e72e599c74bc057ee3c51a4bbcc5e Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 4 Nov 2021 14:09:12 -0400 Subject: [PATCH] Fix return URLs for contact assignment edit/delete --- netbox/templates/inc/panels/contacts.html | 6 +++--- netbox/tenancy/views.py | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/netbox/templates/inc/panels/contacts.html b/netbox/templates/inc/panels/contacts.html index 33788a561..872c11153 100644 --- a/netbox/templates/inc/panels/contacts.html +++ b/netbox/templates/inc/panels/contacts.html @@ -21,12 +21,12 @@ {{ contact.get_priority_display|placeholder }} {% if perms.tenancy.change_contactassignment %} - + {% endif %} {% if perms.tenancy.delete_contactassignment %} - + {% endif %} @@ -41,7 +41,7 @@ {% if perms.tenancy.add_contactassignment %} diff --git a/netbox/tenancy/views.py b/netbox/tenancy/views.py index dcef3d8be..5dadf86fb 100644 --- a/netbox/tenancy/views.py +++ b/netbox/tenancy/views.py @@ -351,12 +351,6 @@ class ContactAssignmentEditView(generic.ObjectEditView): instance.object = get_object_or_404(content_type.model_class(), pk=request.GET.get('object_id')) return instance - def get_return_url(self, request, obj=None): - return obj.object.get_absolute_url() if obj else super().get_return_url(request) - class ContactAssignmentDeleteView(generic.ObjectDeleteView): queryset = ContactAssignment.objects.all() - - def get_return_url(self, request, obj=None): - return obj.object.get_absolute_url() if obj else super().get_return_url(request)