From e59ee3e01e29408609a4b91486fccc65456f7c7f Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 5 Dec 2023 10:29:17 -0500 Subject: [PATCH] Fixes #14397: Pass a mutable copy of request data when provisioning available IPs --- netbox/ipam/api/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netbox/ipam/api/views.py b/netbox/ipam/api/views.py index 662b393de..8e815817f 100644 --- a/netbox/ipam/api/views.py +++ b/netbox/ipam/api/views.py @@ -1,3 +1,5 @@ +from copy import deepcopy + from django.core.exceptions import ObjectDoesNotExist, PermissionDenied from django.db import transaction from django.shortcuts import get_object_or_404 @@ -290,7 +292,7 @@ class AvailableObjectsView(ObjectValidationMixin, APIView): ) # Prepare object data for deserialization - requested_objects = self.prep_object_data(requested_objects, available_objects, parent) + requested_objects = self.prep_object_data(deepcopy(requested_objects), available_objects, parent) # Initialize the serializer with a list or a single object depending on what was requested serializer_class = get_serializer_for_model(self.queryset.model)