1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#10094 fix Contact AddAnother

This commit is contained in:
Arthur
2022-08-22 16:31:41 -07:00
parent 646272f9b3
commit 9fddd193b9
2 changed files with 14 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
from django.contrib.contenttypes.models import ContentType
from django.http import QueryDict
from django.shortcuts import get_object_or_404
from circuits.models import Circuit
@@ -365,6 +366,15 @@ class ContactAssignmentEditView(generic.ObjectEditView):
instance.object = get_object_or_404(content_type.model_class(), pk=request.GET.get('object_id'))
return instance
def get_extra_addanother_params(self, request, params: dict):
if not params:
params = QueryDict(mutable=True)
params['content_type'] = request.GET.get('content_type')
params['object_id'] = request.GET.get('object_id')
return params
class ContactAssignmentDeleteView(generic.ObjectDeleteView):
queryset = ContactAssignment.objects.all()