mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
19644 set atomic transactions to appropriate database
This commit is contained in:
parent
78f1e7d618
commit
9e2248cbf1
@ -295,7 +295,7 @@ class AvailableObjectsView(ObjectValidationMixin, APIView):
|
|||||||
|
|
||||||
# Create the new IP address(es)
|
# Create the new IP address(es)
|
||||||
try:
|
try:
|
||||||
with transaction.atomic(using=router.db_for_write(serializer.Meta.model)):
|
with transaction.atomic(using=router.db_for_write(self.queryset.model)):
|
||||||
created = serializer.save()
|
created = serializer.save()
|
||||||
self._validate_objects(created)
|
self._validate_objects(created)
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
|
Loading…
Reference in New Issue
Block a user